Skip to content

Commit dfd2154

Browse files
authored
Merge pull request #262 from CodIN-INU/fix/login-redirect-issue
fix: Session 설정 수정 #259
2 parents f7e7647 + 138be70 commit dfd2154

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

src/main/java/inu/codin/codin/common/security/controller/AuthController.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ public ResponseEntity<SingleResponse<?>> googleLogin(
3535
@RequestParam(required = false, value = "redirect_host") String redirect_host,
3636
@RequestParam(required = false, value = "redirect_path") String redirect_path
3737
) throws IOException {
38-
authSessionService.setSession(redirect_host);
39-
authSessionService.setSession(redirect_path);
38+
authSessionService.setRedirectHostSession(redirect_host);
39+
authSessionService.setRedirectPathSession(redirect_path);
4040
response.sendRedirect("/api/oauth2/authorization/google");
4141
return ResponseEntity.ok()
4242
.body(new SingleResponse<>(200, "google OAuth2 Login Redirect",null));

src/main/java/inu/codin/codin/common/security/service/AuthSessionService.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ public class AuthSessionService {
1212

1313
private final HttpSession httpSession;
1414

15-
public void setSession(String redirectUrl) {
16-
if (!Objects.equals(redirectUrl, null)) httpSession.setAttribute("redirect_url", redirectUrl);
15+
public void setRedirectHostSession(String redirectHost) {
16+
if (!Objects.equals(redirectHost, null)) httpSession.setAttribute("redirect_host", redirectHost);
17+
}
18+
19+
public void setRedirectPathSession(String redirectPath) {
20+
if (!Objects.equals(redirectPath, null)) httpSession.setAttribute("redirect_path", redirectPath);
1721
}
1822
}

0 commit comments

Comments
 (0)