Skip to content

Commit

Permalink
fix: 로그인에 권한 확인 로직 추가 (#397)
Browse files Browse the repository at this point in the history
(cherry picked from commit 112c949)
  • Loading branch information
seongjae6751 authored and Choi-JJunho committed May 9, 2024
1 parent 1103369 commit 817073b
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ public UserLoginResponse login(UserLoginRequest request) {
throw new IllegalArgumentException("비밀번호가 틀렸습니다.");
}

if (!user.isAuthed()) {
throw new AuthorizationException("미인증 상태입니다. 아우누리에서 인증메일을 확인해주세요");
}

String accessToken = jwtProvider.createToken(user);
String refreshToken = String.format("%s-%d", UUID.randomUUID(), user.getId());
UserToken savedToken = userTokenRepository.save(UserToken.create(user.getId(), refreshToken));
Expand Down

0 comments on commit 817073b

Please sign in to comment.