Skip to content

Commit

Permalink
feat: generate a new token for ws server and assistant service with 2…
Browse files Browse the repository at this point in the history
…4h expire time
  • Loading branch information
JoseAlbDR committed Apr 4, 2024
1 parent 738f435 commit 43272d4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/presentation/middlewares/auth.middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ export class AuthMiddleware {
const payload = this.jwt.validateToken(accessToken);
if (!payload) throw new UnauthorizedError('Invalid token validation');
req.user = payload.user;
req.user.wsToken = accessToken;
const wsToken = this.jwt.generateToken({ user: payload.user }, '1d');
req.user.wsToken = wsToken;
return next();
}

Expand Down

0 comments on commit 43272d4

Please sign in to comment.