Skip to content

Commit

Permalink
Dont replace underscores
Browse files Browse the repository at this point in the history
  • Loading branch information
vej-ananas committed Sep 3, 2024
1 parent 565fc8a commit 8540456
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion apps/server-asset-sg/src/core/middleware/jwt.middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ export class JwtMiddleware implements NestMiddleware {
if (!('username' in payload) || payload.username.length === 0) {
throw new HttpException('invalid JWT payload: missing username', 401);
}
const email = payload.username.split('_').slice(1).join('');
const email = payload.username.split('_').slice(1).join('_');
if (email == null || !/^.+@.+\..+$/.test(email)) {
throw new HttpException('invalid JWT payload: username does not contain an email', 401);
}
Expand Down

0 comments on commit 8540456

Please sign in to comment.