Skip to content

[fix] Token 갱신 시 발생하는 500 에러 잡기#273

Merged
wldks1008 merged 1 commit intodevelopfrom
fix/272
Mar 31, 2025
Merged

[fix] Token 갱신 시 발생하는 500 에러 잡기#273
wldks1008 merged 1 commit intodevelopfrom
fix/272

Conversation

@wldks1008
Copy link
Member

Related Issue 📌

close #272

Description ✔️

  • refresh Token에서 claim 가져오기 전 검증 수행

To Reviewers

@wldks1008 wldks1008 requested review from Parkjyun and Copilot March 27, 2025 06:58
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a 500 error occurring during token refresh by adding a pre-validation step for refresh tokens and refactoring the token generation logic.

  • Added an early call to validate the refresh token
  • Removed duplicate token validation
  • Reformatted event publication code in user creation
Comments suppressed due to low confidence (2)

src/main/java/org/hankki/hankkiserver/api/auth/service/AuthService.java:56

  • Ensure that jwtValidator.validateRefreshToken consistently handles tokens with or without the BEARER prefix. If the expected format is without the prefix, consider using the strippedToken for validation.
jwtValidator.validateRefreshToken(refreshToken);

src/main/java/org/hankki/hankkiserver/api/auth/service/AuthService.java:59

  • Confirm that generateTokens properly updates the user's refresh token as the previous implementation explicitly updated it via userInfo.
return generateTokens(userId);

@wldks1008 wldks1008 self-assigned this Mar 31, 2025
@wldks1008 wldks1008 added bug Something isn't working api labels Mar 31, 2025
@wldks1008 wldks1008 merged commit 715a035 into develop Mar 31, 2025
1 check passed
@wldks1008 wldks1008 deleted the fix/272 branch March 31, 2025 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[fix] Token 갱신 시 발생하는 500 에러 잡기

1 participant