Skip to content

Commit

Permalink
chore: make canActivate async
Browse files Browse the repository at this point in the history
  • Loading branch information
pratapalakshmi committed Dec 15, 2024
1 parent e4ec6f3 commit 02aa5b9
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export class LocalAuthGuard extends AuthGuard('local') implements CanActivate {
super();
}

canActivate(context: ExecutionContext): Promise<boolean> {
async canActivate(context: ExecutionContext): Promise<boolean> {
const result = super.canActivate(context) as boolean;
const request = context.switchToHttp().getRequest();
if (result && request.user) {
Expand All @@ -19,3 +19,4 @@ export class LocalAuthGuard extends AuthGuard('local') implements CanActivate {
return Promise.resolve(result);
}
}

0 comments on commit 02aa5b9

Please sign in to comment.