AuthZOptions: {
    algorithms?: Algorithm[];
    onAuthorization?: (decodedToken: JwtPayload) => {};
    role?: string | string[];
    secret?: string;
}

Options for configuring authorization middleware

Type declaration

  • Optionalalgorithms?: Algorithm[]

    The algorithms used for JWT token verification

  • OptionalonAuthorization?: (decodedToken: JwtPayload) => {}

    A callback function called when authorization is successful.

  • Optionalrole?: string | string[]

    The role(s) required for accessing the protected route

  • Optionalsecret?: string

    The secret used to sign and verify JWT tokens