Skip to content

Commit 2ed6dd2

Browse files
authored
Merge pull request #65 from WishWesee/develop
[DEPLOY]
2 parents 256f302 + 32cb108 commit 2ed6dd2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/main/java/depth/main/wishwesee/global/config/security/handler/CustomSimpleUrlAuthenticationSuccessHandler.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import jakarta.servlet.http.HttpServletResponse;
1515
import jakarta.servlet.http.Cookie;
1616
import lombok.RequiredArgsConstructor;
17+
import org.springframework.beans.factory.annotation.Value;
1718
import org.springframework.security.core.Authentication;
1819
import org.springframework.security.web.authentication.SimpleUrlAuthenticationSuccessHandler;
1920
import org.springframework.stereotype.Component;
@@ -34,6 +35,9 @@ public class CustomSimpleUrlAuthenticationSuccessHandler extends SimpleUrlAuthen
3435
private final TokenRepository tokenRepository;
3536
private final CustomAuthorizationRequestRepository customAuthorizationRequestRepository;
3637

38+
@Value("${custom.success-handler.host}")
39+
private String HOST;
40+
3741
@Override
3842
public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws IOException, ServletException {
3943
DefaultAssert.isAuthentication(!response.isCommitted());
@@ -65,7 +69,7 @@ protected String determineTargetUrl(HttpServletRequest request, HttpServletRespo
6569

6670
URI uri = URI.create(targetUrl);
6771
return UriComponentsBuilder.fromUri(uri)
68-
.host("localhost:3000")
72+
.host(HOST)
6973
.queryParam("token", tokenMapping.getAccessToken())
7074
.build()
7175
.toUriString();

0 commit comments

Comments
 (0)