Skip to content

Commit

Permalink
fix : response header Set-Cookie
Browse files Browse the repository at this point in the history
  • Loading branch information
LJH098 committed Feb 26, 2024
1 parent 96db04a commit e54a722
Showing 1 changed file with 10 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,25 +61,19 @@ public ResponseEntity<TokenResponse> login(
TokenResponse tokenResponse = userLoginUseCase.execute(loginRequestDto);
response.addHeader(
"Set-Cookie",
new StringBuilder(
SecurityUtils.setLocalCookie(
"ACCESS_TOKEN", tokenResponse.getAccessToken())
.toString())
.append("; ")
.append(
SecurityUtils.setLocalCookie(
"REFRESH_TOKEN", tokenResponse.getRefreshToken()))
SecurityUtils.setLocalCookie("ACCESS_TOKEN", tokenResponse.getAccessToken())
.toString());
response.addHeader(
"Set-Cookie",
new StringBuilder(
SecurityUtils.setProdCookie(
"ACCESS_TOKEN", tokenResponse.getAccessToken())
.toString())
.append("; ")
.append(
SecurityUtils.setProdCookie(
"REFRESH_TOKEN", tokenResponse.getRefreshToken()))
SecurityUtils.setProdCookie("ACCESS_TOKEN", tokenResponse.getAccessToken())
.toString());
response.addHeader(
"Set-Cookie",
SecurityUtils.setLocalCookie("REFRESH_TOKEN", tokenResponse.getRefreshToken())
.toString());
response.addHeader(
"Set-Cookie",
SecurityUtils.setProdCookie("REFRESH_TOKEN", tokenResponse.getRefreshToken())
.toString());
return new ResponseEntity<>(tokenResponse, HttpStatus.OK);
}
Expand Down

0 comments on commit e54a722

Please sign in to comment.