Repository navigation
refactor: Token VO 적용, 제공과 저장 관심사 분리, 환경변수 사용하도록 수정 #479
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 23 commits
b61bed8
4b3d811
332be93
3a4cc07
7bf9d9d
5a1ee42
1319eae
15709d6
0aa559a
25e94f5
57ba58c
5b75f99
d348386
bad0187
a5e05ca
bb371a4
cef0864
a75f144
baecd6a
7a2acdf
b085289
66f4cb4
21542c6
97d3075
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| package com.example.solidconnection.auth.domain; | ||
|
|
||
| public record AccessToken( | ||
| String token | ||
| ) implements Token { | ||
|
|
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| package com.example.solidconnection.auth.domain; | ||
|
|
||
| public record RefreshToken( | ||
| String token | ||
| ) implements Token { | ||
|
|
||
| } | ||
|
nayonsoso marked this conversation as resolved.
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| package com.example.solidconnection.auth.domain; | ||
|
|
||
| public record SignUpToken( | ||
| String token | ||
| ) implements Token { | ||
|
|
||
| } | ||
|
nayonsoso marked this conversation as resolved.
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| package com.example.solidconnection.auth.domain; | ||
|
|
||
| public interface Token { | ||
|
|
||
| String token(); | ||
| } | ||
|
nayonsoso marked this conversation as resolved.
|
||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 기존의 문제점 : TokenType enum 에서 [어떤 prefix로], [얼마동안] 토큰을 저장할 것인지 노출 |
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,7 @@ | |
| import static com.example.solidconnection.common.exception.ErrorCode.REFRESH_TOKEN_EXPIRED; | ||
| import static com.example.solidconnection.common.exception.ErrorCode.USER_NOT_FOUND; | ||
|
|
||
| import com.example.solidconnection.auth.domain.AccessToken; | ||
| import com.example.solidconnection.auth.dto.ReissueResponse; | ||
| import com.example.solidconnection.auth.token.TokenBlackListService; | ||
| import com.example.solidconnection.common.exception.CustomException; | ||
|
|
@@ -26,11 +27,9 @@ public class AuthService { | |
| * - 엑세스 토큰을 블랙리스트에 추가한다. | ||
| * - 리프레시 토큰을 삭제한다. | ||
| * */ | ||
| public void signOut(String token) { | ||
| SiteUser siteUser = authTokenProvider.parseSiteUser(token); | ||
| AccessToken accessToken = authTokenProvider.generateAccessToken(siteUser); | ||
| authTokenProvider.deleteRefreshTokenByAccessToken(accessToken); | ||
| public void signOut(String accessToken) { | ||
| tokenBlackListService.addToBlacklist(accessToken); | ||
| authTokenProvider.deleteRefreshTokenByAccessToken(accessToken); | ||
|
Comment on lines
-29
to
+32
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| } | ||
|
|
||
| /* | ||
|
|
||
This file was deleted.
This file was deleted.

Uh oh!
There was an error while loading. Please reload this page.