diff --git a/server/src/main/java/server/haengdong/presentation/UserController.java b/server/src/main/java/server/haengdong/presentation/UserController.java index d93e784d..a3fad6bd 100644 --- a/server/src/main/java/server/haengdong/presentation/UserController.java +++ b/server/src/main/java/server/haengdong/presentation/UserController.java @@ -4,6 +4,7 @@ import java.net.URI; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; @@ -32,6 +33,9 @@ public class UserController { private final AuthService authService; private final CookieProperties cookieProperties; + @Value("${login-success.uri}") + private String loginSuccessUri; + @PatchMapping("/api/admin/users") public ResponseEntity updateUser( @Login Long userId, @@ -58,8 +62,9 @@ public ResponseEntity kakaoLogin(@RequestParam String code) { String jwtToken = authService.createGuestToken(userId); ResponseCookie responseCookie = createResponseCookie(jwtToken); - return ResponseEntity.ok() + return ResponseEntity.status(HttpStatus.MOVED_PERMANENTLY) .header(HttpHeaders.SET_COOKIE, responseCookie.toString()) + .location(URI.create(loginSuccessUri)) .build(); } diff --git a/server/src/main/resources/application.yml b/server/src/main/resources/application.yml index 9595a5d5..6298b671 100644 --- a/server/src/main/resources/application.yml +++ b/server/src/main/resources/application.yml @@ -77,6 +77,9 @@ kakao: client-id: 52f24834ff7304ed2c47294b3f57b053 oauth-code-uri: https://kauth.kakao.com/oauth/authorize?client_id=%s&redirect_uri=%s&response_type=code&scope=openid +login-success: + uri: https://dev.haengdong.pro/event/create + --- spring: diff --git a/server/src/main/resources/config b/server/src/main/resources/config index ae3c392e..6cc0c6a5 160000 --- a/server/src/main/resources/config +++ b/server/src/main/resources/config @@ -1 +1 @@ -Subproject commit ae3c392e6b7bc0aa4a2daff1ad3237f81d5f8a79 +Subproject commit 6cc0c6a583932dea92a8e98e86ecf7b5b350d286