-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore(util): ms 패키지 추가 * feat: DTO 수정 * feat: Exception 수정 * test: Mocking 및 테스트 추가 * refactor: jwt expires를 호출 당시에 쓰도록 * feat: 리프레시 토큰 구현
- Loading branch information
1 parent
44ee3a9
commit 9a28473
Showing
21 changed files
with
265 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
// Request | ||
export * from './request/login.request.dto'; | ||
export * from './request/refresh.request.dto'; | ||
export * from './request/register.request.dto'; | ||
export * from './request/send-code.request.dto'; | ||
export * from './request/verify-code.request.dto'; | ||
|
||
// Response | ||
export * from './response/login.response.dto'; | ||
export * from './response/my-info.response.dto'; | ||
export * from './response/refresh.response.dto'; | ||
export * from './response/verify-code.response.dto'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { ApiProperty } from '@nestjs/swagger'; | ||
|
||
import { CommonValidation, TypeValidation } from '@wink/validation'; | ||
|
||
export class RefreshRequestDto { | ||
@ApiProperty({ | ||
description: 'Refresh Token', | ||
example: 'A.B.C', | ||
}) | ||
@CommonValidation.IsNotEmpty() | ||
@TypeValidation.IsString() | ||
refreshToken!: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { ApiProperty } from '@nestjs/swagger'; | ||
|
||
export class RefreshResponseDto { | ||
@ApiProperty({ | ||
description: 'Access Token', | ||
example: 'A.B.C', | ||
}) | ||
accessToken!: string; | ||
|
||
@ApiProperty({ | ||
description: 'Refresh Token', | ||
example: 'A.B.C', | ||
}) | ||
refreshToken!: string; | ||
} |
13 changes: 13 additions & 0 deletions
13
src/domain/auth/exception/expired-access-token.exception.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { HttpStatus } from '@nestjs/common'; | ||
|
||
import { ApiException } from '@wink/swagger'; | ||
|
||
export class ExpiredAccessTokenException extends ApiException { | ||
constructor() { | ||
super({ | ||
swagger: '접근 토큰이 만료되었을 때', | ||
message: '접근 토큰이 만료되었습니다.', | ||
code: HttpStatus.UNAUTHORIZED, | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
src/domain/auth/exception/invalid-refresh-token.exception.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { HttpStatus } from '@nestjs/common'; | ||
|
||
import { ApiException } from '@wink/swagger'; | ||
|
||
export class InvalidRefreshTokenException extends ApiException { | ||
constructor() { | ||
super({ | ||
swagger: '잘못된 리프레시 토큰일 때', | ||
message: '올바르지 않은 리프레시 토큰입니다.', | ||
code: HttpStatus.UNAUTHORIZED, | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.