Skip to content

Commit

Permalink
fix(auth): expire JWT always
Browse files Browse the repository at this point in the history
  • Loading branch information
sg-gs committed Jun 12, 2024
1 parent cf56fc0 commit 7a78ae4
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions src/modules/user/user.usecase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -417,8 +417,16 @@ export class UserUseCases {
const newTokenPayload = this.getNewTokenPayload(user);

return {
token: SignEmail(newUser.email, this.configService.get('secrets.jwt')),
newToken: Sign(newTokenPayload, this.configService.get('secrets.jwt')),
token: SignEmail(
newUser.email,
this.configService.get('secrets.jwt'),
true,
),
newToken: Sign(
newTokenPayload,
this.configService.get('secrets.jwt'),
true,
),
user: {
...user.toJSON(),
hKey: user.hKey.toString(),
Expand Down Expand Up @@ -1070,8 +1078,16 @@ export class UserUseCases {
return {
...emails,
newAuthentication: {
token: SignEmail(user.email, this.configService.get('secrets.jwt')),
newToken: Sign(newTokenPayload, this.configService.get('secrets.jwt')),
token: SignEmail(
user.email,
this.configService.get('secrets.jwt'),
true,
),
newToken: Sign(
newTokenPayload,
this.configService.get('secrets.jwt'),
true,
),
user,
},
};
Expand Down

0 comments on commit 7a78ae4

Please sign in to comment.