Skip to content

Commit

Permalink
handle user is active at login in jwt strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeh committed Sep 26, 2024
1 parent 6a894b6 commit 9c86d32
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion api/src/modules/auth/strategies/jwt.strategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export class JwtStrategy extends PassportStrategy(Strategy) {
async validate(payload: JwtPayload) {
const { id } = payload;
const user = await this.userService.findOneBy(id);
if (!user) {
if (!user || !user.isActive) {
throw new UnauthorizedException();
}
return user;
Expand Down

0 comments on commit 9c86d32

Please sign in to comment.