Skip to content

Commit

Permalink
style : spotless
Browse files Browse the repository at this point in the history
  • Loading branch information
LJH098 committed Feb 26, 2024
1 parent d320ab1 commit 93f5b7c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import com.econovation.recruitdomain.domains.interviewer.domain.Role;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import lombok.RequiredArgsConstructor;
Expand Down Expand Up @@ -60,10 +59,17 @@ public ResponseEntity<TokenResponse> issueToken() {
public ResponseEntity<TokenResponse> login(
@RequestBody LoginRequestDto loginRequestDto, HttpServletResponse response) {
TokenResponse tokenResponse = userLoginUseCase.execute(loginRequestDto);
response.addHeader("Set-Cookie", new StringBuilder(SecurityUtils.setCookie("ACCESS_TOKEN", tokenResponse.getAccessToken()).toString())
.append("; ")
.append(SecurityUtils.setCookie("REFRESH_TOKEN", tokenResponse.getRefreshToken()))
.toString());
response.addHeader(
"Set-Cookie",
new StringBuilder(
SecurityUtils.setCookie(
"ACCESS_TOKEN", tokenResponse.getAccessToken())
.toString())
.append("; ")
.append(
SecurityUtils.setCookie(
"REFRESH_TOKEN", tokenResponse.getRefreshToken()))
.toString());
return new ResponseEntity<>(tokenResponse, HttpStatus.OK);
}

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

public class SecurityUtils {
public static ResponseCookie setCookie(String name, String value) {
return ResponseCookie.from(name,value)
return ResponseCookie.from(name, value)
.secure(true)
.sameSite("None")
.httpOnly(true)
Expand Down

0 comments on commit 93f5b7c

Please sign in to comment.