-
Notifications
You must be signed in to change notification settings - Fork 0
feat: 인증 기능 구현 #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
Conversation
fallback은 따로 구현해주지 않아서 NoFallbackAvailableException.class를 기준으로 예외처리를 해주었습니다.
| } | ||
|
|
||
| private void validateStoredRefreshToken(final String email, final String requestToken) { | ||
| String storedToken = redisTokenRepository.findByEmail(email) |
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 storedToken = redisTokenRepository.findByEmail(email)
.map(s -> {
if (!s.equals(requestToken)) {
throw new BusinessException(ErrorCode.INVALID_TOKEN);
}
return s;
})
.orElseThrow(() -> new BusinessException(ErrorCode.NOT_FOUND_TOKEN));
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 storedToken = redisTokenRepository.findByEmail(email)
.filter(s -> s.equals(requestToken))
.orElseThrow(() -> new BusinessException(ErrorCode. INVALID_TOKEN));
| final String refreshToken = tokenProvider.createRefreshToken(email, userType, userStatus); | ||
|
|
||
| redisTokenRepository.save(email, refreshToken); | ||
| return Token.of(accessToken, refreshToken); |
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.
new Token(accessToken, refreshToken);
| .parseClaimsJws(token); | ||
|
|
||
| }catch (final JwtException | IllegalArgumentException e) { | ||
| return false; |
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.
logger.error(e.getMessage(), e)
| import jakarta.validation.constraints.NotBlank; | ||
|
|
||
| public record LoginRequestDto( | ||
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.
email검사 심플하게 하는 경우
- 사용 불가 특수문자 있나 확인.
- @ 하나만 잇는지 확인.
- @ 다음 문자열에 . 이 하나 혹은 두개만 있는지 확인 -> @ 다른 문자열에 . 이 있는지 확인
- @ 도메인에서 사용하지 못하는 특수문자 있는지 확인
작업 내용
추가 사항
관련 이슈