Skip to content

Commit

Permalink
refactor(auth): add token rotation feature
Browse files Browse the repository at this point in the history
  • Loading branch information
KNU-K committed Nov 25, 2024
1 parent 67453c0 commit 4b4eff0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/modules/auth/application/service/auth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ export class AuthService {
return await this.issueToken(payload, this.accessJwtSignOptions);
}
private async issueRefreshToken(payload) {
return await this.issueToken(payload, this.refreshJwtSignOptions);
const refreshToken = await this.issueToken(payload, this.refreshJwtSignOptions);
await this.redisService.set(payload.sub, refreshToken);
return refreshToken;
}
private async issueToken(payload, options) {
return await this.jwtService.signAsync(payload, options);
Expand Down

0 comments on commit 4b4eff0

Please sign in to comment.