config/CustomOAuth2SuccessHandler.java
[Vulnerable Target View]
// VULNERABLE: Setting SameSite=Strict forces browsers to strip the
// 'refresh_token' cookie during top-level cross-site OAuth redirects.
ResponseCookie refreshCookie = ResponseCookie.from("refresh_token", refreshToken)
.path("/")
.httpOnly(true)
.secure(isSecure)
.sameSite("Strict") // <--- Root cause: Stripped on OAuth redirect GET!
.maxAge(604800)
.build();
response.addHeader("Set-Cookie", refreshCookie.toString());
getRedirectStrategy().sendRedirect(request, response, "http://localhost:5173/oauth2/callback");