Skip to content

Commit 877f1fe

Browse files
committed
🐛 fix: OAuth 인증 성공 시 redirect 경로 지정
1 parent 517c728 commit 877f1fe

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

backend/src/main/java/io/f1/backend/domain/user/app/handler/OAuthSuccessHandler.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
@RequiredArgsConstructor
2121
public class OAuthSuccessHandler extends SimpleUrlAuthenticationSuccessHandler {
2222

23-
private final ObjectMapper objectMapper;
24-
2523
@Override
2624
public void onAuthenticationSuccess(
2725
HttpServletRequest request, HttpServletResponse response, Authentication authentication)
@@ -30,13 +28,9 @@ public void onAuthenticationSuccess(
3028
response.setContentType("application/json;charset=UTF-8");
3129

3230
if (principal.getUserNickname() == null) {
33-
// 닉네임 설정 필요 → 202 Accepted
34-
response.setStatus(HttpServletResponse.SC_ACCEPTED);
35-
objectMapper.writeValue(response.getWriter(), Map.of("message", "닉네임을 설정하세요."));
31+
response.sendRedirect("/signup");
3632
} else {
37-
// 정상 로그인 → 200 OK
38-
response.setStatus(HttpServletResponse.SC_OK);
39-
objectMapper.writeValue(response.getWriter(), Map.of("message", "로그인 성공"));
33+
response.sendRedirect("/room");
4034
}
4135
}
4236
}

0 commit comments

Comments
 (0)