Skip to content

Commit f50dc89

Browse files
committed
feat: method to get custom claims
1 parent 2ec3061 commit f50dc89

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/http/auth.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,11 @@ export abstract class CognitoAuthorizer {
115115
this.assertAuthenticated();
116116
return this.claims!.sub as string;
117117
}
118+
119+
public getClaim(name: string): string | number | boolean | string[] | undefined {
120+
this.assertAuthenticated();
121+
return this.claims![name];
122+
}
118123
}
119124

120125
export class ApiGatewayv2CognitoAuthorizer extends CognitoAuthorizer {

0 commit comments

Comments
 (0)