lbx-jwt
Version:
Provides JWT authentication for loopback applications. Includes storing roles inside tokens and handling refreshing. Built-in reuse detection.
9 lines (8 loc) • 587 B
TypeScript
import { AuthorizationContext, AuthorizationDecision, AuthorizationMetadata } from '@loopback/authorization';
/**
* Checks if the requesting user has one of the allowed roles.
* @param authorizationContext - The context, containing the user information.
* @param metadata - The metadata, provided in the @authorize-decorator. Contains allowed roles.
* @returns The promise of a decision (if the request is denied or approved).
*/
export declare function roleAuthorization(authorizationContext: AuthorizationContext, metadata: AuthorizationMetadata): Promise<AuthorizationDecision>;