• Used to protect an API endpoint that requires the user to be logged in.

    Parameters

    • req: ReqType

      API Request object

    • res: ResType

      API Response object

    Returns Promise<User | false>

    Either the user, or false (unable to authenticate)