Skip to content

Commit

Permalink
fix bug missing id in payload
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeh committed Oct 19, 2024
1 parent 96ea116 commit 036a6eb
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions api/src/modules/auth/strategies/email-update.strategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { ExtractJwt, Strategy } from 'passport-jwt';
import { UsersService } from '@api/modules/users/users.service';
import { ApiConfigService } from '@api/modules/config/app-config.service';
import { TOKEN_TYPE_ENUM } from '@shared/schemas/auth/token-type.schema';
import { Request } from 'express';

export type JwtPayload = { id: string };

Expand All @@ -28,7 +27,7 @@ export class EmailConfirmationJwtStrategy extends PassportStrategy(
});
}

async validate(req: Request, payload: JwtPayload) {
async validate(payload: JwtPayload) {
const { id } = payload;
const user = await this.userService.findOneBy(id);
if (!user) {
Expand Down

0 comments on commit 036a6eb

Please sign in to comment.