Skip to content

Commit

Permalink
[feat]: refactor Cookie seperate 2
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackBean99 committed Feb 26, 2024
1 parent 65ae450 commit 165b679
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 10 deletions.
Binary file modified server/.gradle/7.6.1/executionHistory/executionHistory.bin
Binary file not shown.
Binary file modified server/.gradle/7.6.1/executionHistory/executionHistory.lock
Binary file not shown.
Binary file modified server/.gradle/7.6.1/fileHashes/fileHashes.bin
Binary file not shown.
Binary file modified server/.gradle/7.6.1/fileHashes/fileHashes.lock
Binary file not shown.
Binary file modified server/.gradle/buildOutputCleanup/buildOutputCleanup.lock
Binary file not shown.
Binary file modified server/.gradle/file-system.probe
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,11 @@ 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("REFRESH_TOKEN", tokenResponse.getRefreshToken())
.toString());
response.addHeader(
"Set-Cookie",
SecurityUtils.setLocalCookie("ACCESS_TOKEN", tokenResponse.getAccessToken())
.toString());
return new ResponseEntity<>(tokenResponse, HttpStatus.OK);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
public class SecurityUtils {
public static ResponseCookie setLocalCookie(String name, String value) {
return ResponseCookie.from(name, value)
.path("/")
.secure(true)
.sameSite("None")
.httpOnly(true)
.maxAge(2592000)
.path("/")
.domain("localhost")
.domain("127.0.0.1")
.build();
}

Expand Down

0 comments on commit 165b679

Please sign in to comment.