middy-middleware-jwt-auth
    Preparing search index...

    Class JWTAuthMiddleware<Payload>

    The actual middleware

    Type Parameters

    • Payload
    Index

    Constructors

    Properties

    Methods

    Constructors

    Properties

    before: MiddlewareFn = ...

    Checks for an authentication token, saves its content to event.auth and throws errors if anything fishy goes on. It will pass if no authorization header is present, but will ensure that event.auth is undefined in those cases. Authorization or authorization headers will both be checked. If both exist, the middleware will throw an error. If options.tokenSource is set, then that function will be used to retrieve the token and Headers will serve as fallback.

    The event to check

    Methods