-
Notifications
You must be signed in to change notification settings - Fork 6
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
사용자 인증에서 카카오 계정 전환 엣지 케이스 수정 #669
Conversation
|
||
@Component | ||
public class AccessTokenProvider { | ||
|
||
public static final String MEMBER_ID_CLAIM_KEY = "id"; | ||
public static final String SOCIAL_LOGIN_ID_CLAIM_KEY = "socialLoginId"; | ||
private static final String OAUTH_TYPE = "oauthType"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
위에 두 개 상수 지금보니까 public 이네욤
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Claims claims = getPayload(token); | ||
|
||
if (claims.getExpiration().before(new Date())) { | ||
throw new AuthException(HttpStatus.UNAUTHORIZED, AuthErrorMessage.UNAUTHORIZED); | ||
} | ||
if (claims.get(OAUTH_TYPE) == OauthType.KAKAO.toString()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
string을 == 로 비교하면 항상 다르지 않나용? 그리고 string으로 비교하는 이유가 있나요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
짜증나게 하지마요
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
까불지마세요
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
잘하십시오
public void validateToken(String token) { | ||
Claims claims = getPayload(token); | ||
|
||
if (claims.getExpiration().before(new Date())) { | ||
throw new AuthException(HttpStatus.UNAUTHORIZED, AuthErrorMessage.UNAUTHORIZED); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no test
PR의 목적이 무엇인가요?
사용자 인증에서 카카오 계정 전환 엣지 케이스 수정
이슈 ID는 무엇인가요?
설명
현재 카카오 계정 전환 플로우는 다음과 같습니다.
만약 사용자가 카카오 로그인만 진행 후 밖으로 나온다면
accessToken 을 가지고 있는 상태가 됨
이를 처리하기 위해 accessToken 에 OauthType을 추가한다.
인터셉터에서 OauthType이 Kakao 인 토큰을 가지고 접근하려고 하면 예외를 발생
질문 혹은 공유 사항 (Optional)