Class: CheckAuthAccessTokenGuard
api-internal/check-auth-access-token.guard.CheckAuthAccessTokenGuard
Guard for checking the presence of an access token in the request. If needed, checks for admin permissions of the user.
Used with @UseGuards(CheckAuthAccessTokenGuard)
The access token is expected in the "Authorization" header, prefixed with "Bearer ". Not providing a token, a token without prefix or an invalid token will result in a 401 Unauthorized response.
Once access token (and admin permission) were verified sucessfully, the logged in user is written to the request state object
Hierarchy
↳
CheckAuthAccessTokenGuard
Constructors
constructor
• new CheckAuthAccessTokenGuard(tokenService
, reflector
, backendUserService
)
Parameters
Name | Type |
---|---|
tokenService | TokenService |
reflector | Reflector |
backendUserService | BackendUserService |
Overrides
CheckAccessTokenGuard.constructor
Defined in
gropius-login-service/backend/src/api-internal/check-auth-access-token.guard.ts:21
Methods
canActivate
▸ canActivate(context
): Promise
<boolean
>
Parameters
Name | Type |
---|---|
context | ExecutionContext |
Returns
Promise
<boolean
>
Inherited from
CheckAccessTokenGuard.canActivate
Defined in
gropius-login-service/backend/src/util/CheckAccessTokenGuard.ts:30