| 80 | * |
| 81 | */ |
| 82 | export interface AuthenticationStrategy { |
| 83 | /** |
| 84 | * The 'name' property is a unique identifier for the |
| 85 | * authentication strategy ( for example : 'basic', 'jwt', etc) |
| 86 | */ |
| 87 | name: string; |
| 88 | |
| 89 | /** |
| 90 | * The 'authenticate' method takes in a given request and returns a user profile |
| 91 | * which is an instance of 'UserProfile'. |
| 92 | * (A user profile is a minimal subset of a user object) |
| 93 | * If the user credentials are valid, this method should return a 'UserProfile' instance. |
| 94 | * If the user credentials are invalid, this method should throw an error |
| 95 | * If the user credentials are missing, this method should throw an error, or return 'undefined' |
| 96 | * and let the authentication action deal with it. |
| 97 | * |
| 98 | * @param request - Express request object |
| 99 | */ |
| 100 | authenticate( |
| 101 | request: Request, |
| 102 | ): Promise<UserProfile | RedirectRoute | undefined>; |
| 103 | } |
| 104 | |
| 105 | export const AUTHENTICATION_STRATEGY_NOT_FOUND = |
| 106 | 'AUTHENTICATION_STRATEGY_NOT_FOUND'; |
no outgoing calls
no test coverage detected