Skip to content

Conversation

@sangyunpark99
Copy link
Collaborator

작업 내용

  • 로그인(토큰 발급)
  • 토큰 재발급 기능
  • 토큰 필터링
  • 로그 아웃(블랙 리스트 처리)

추가 사항

  • 단위 테스트
  • 통합 테스트

관련 이슈

}

private void validateStoredRefreshToken(final String email, final String requestToken) {
String storedToken = redisTokenRepository.findByEmail(email)
Copy link
Collaborator

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));

Copy link
Collaborator

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);
Copy link
Collaborator

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;
Copy link
Collaborator

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(
@Email
Copy link
Collaborator

@f-lab-nolan f-lab-nolan Apr 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

email검사 심플하게 하는 경우

  1. 사용 불가 특수문자 있나 확인.
  2. @ 하나만 잇는지 확인.
  3. @ 다음 문자열에 . 이 하나 혹은 두개만 있는지 확인 -> @ 다른 문자열에 . 이 있는지 확인
  4. @ 도메인에서 사용하지 못하는 특수문자 있는지 확인

@sangyunpark99 sangyunpark99 merged commit 5064fbd into develop Apr 14, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants