File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
apps/backend/src/auth/token Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 11import { Injectable } from '@nestjs/common' ;
22import { JwtService } from '@nestjs/jwt' ;
33import { Response } from 'express' ;
4+ import { InvalidTokenException } from '../../exception/invalid.exception' ;
45
56const HOUR = 60 * 60 ;
67const DAY = 24 * 60 * 60 ;
@@ -33,9 +34,13 @@ export class TokenService {
3334 }
3435
3536 verifyInviteToken ( token : string ) : { workspaceId : string ; role : string } {
36- return this . jwtService . verify ( token , {
37- secret : process . env . JWT_SECRET ,
38- } ) ;
37+ try {
38+ return this . jwtService . verify ( token , {
39+ secret : process . env . JWT_SECRET ,
40+ } ) ;
41+ } catch ( error ) {
42+ throw new InvalidTokenException ( ) ;
43+ }
3944 }
4045
4146 // 후에 DB 로직 (지금은 refreshToken이 DB로 관리 X)
You can’t perform that action at this time.
0 commit comments