Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

redirectTest #150

Merged
merged 2 commits into from
Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
public class Oauth2LoginSuccessHandler extends SimpleUrlAuthenticationSuccessHandler {

private final AuthService authService;
private final ObjectMapper objectMapper;
@Value("${spring.login.app-home-url}")
String rootUrl;
@Value("${spring.login.oauth2-redirect-url}")
Expand Down Expand Up @@ -55,10 +54,12 @@
} else {
/* 회원 가입 필요 */
//todo: url 변경 예정
String redirectUrl = rootUrl
+ oauthRedirectUrl
+ "?email=" + attribute.get("email")
+ "&provider=" + attribute.get("provider");
// String redirectUrl = rootUrl
// + oauthRedirectUrl
// + "?email=" + attribute.get("email")
// + "&provider=" + attribute.get("provider");

Check warning on line 60 in src/main/java/kr/co/fastcampus/yanabada/common/security/oauth/Oauth2LoginSuccessHandler.java

View workflow job for this annotation

GitHub Actions / Checkstyle job

[testtool] reported by reviewdog 🐶 Comment has incorrect indentation level 0, expected is 12, indentation should be the same level as line 61. Raw Output: /github/workspace/./src/main/java/kr/co/fastcampus/yanabada/common/security/oauth/Oauth2LoginSuccessHandler.java:60:1: warning: Comment has incorrect indentation level 0, expected is 12, indentation should be the same level as line 61. (com.puppycrawl.tools.checkstyle.checks.indentation.CommentsIndentationCheck)
String redirectUrl = "https://yanabada-fe-1r96.vercel.app/sigin/3";
log.info("oauth redirect url={}", redirectUrl);
response.sendRedirect(redirectUrl);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.Valid;
import java.io.IOException;
import kr.co.fastcampus.yanabada.common.jwt.dto.TokenRefreshResponse;
import kr.co.fastcampus.yanabada.common.jwt.util.JwtUtils;
import kr.co.fastcampus.yanabada.common.response.ResponseBody;
Expand All @@ -20,6 +21,7 @@
import kr.co.fastcampus.yanabada.domain.member.service.MemberService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
Expand All @@ -35,6 +37,11 @@ public class AuthController {
private final AuthService authService;
private final MemberService memberService;

@GetMapping("/redirect-test")
public void redirectTest(HttpServletResponse response) throws IOException {
response.sendRedirect("https://yanabada-fe-1r96.vercel.app/sigin/3\"");
}

@PostMapping("/sign-up")
public ResponseBody<SignUpResponse> signUp(
@RequestBody @Valid SignUpRequest signUpRequest
Expand Down
Loading