-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: 카카오 로그인 API(/members/login/kakao/oauth) Get -> Post 변경 (#118)
* feat: profile 환경에 따른 cookie 설정 분리 및 config 업데이트 * test: profile에 따른 쿠키 생성 테스트 * feat: Get에서 Post로 변경 * refactor: CookieUtils 변경 * feat: config 변경 * fix: merge confilt 해결 * feat: Cookie secure 추가
- Loading branch information
Showing
12 changed files
with
6,776 additions
and
1,692 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
src/main/java/com/moabam/global/common/util/CookieUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package com.moabam.global.common.util; | ||
|
||
import jakarta.servlet.http.Cookie; | ||
import lombok.AccessLevel; | ||
import lombok.NoArgsConstructor; | ||
|
||
@NoArgsConstructor(access = AccessLevel.PRIVATE) | ||
public class CookieUtils { | ||
|
||
public static Cookie tokenCookie(String name, String value, long expireTime) { | ||
Cookie cookie = new Cookie(name, value); | ||
cookie.setSecure(true); | ||
cookie.setHttpOnly(true); | ||
cookie.setPath("/"); | ||
cookie.setMaxAge((int)expireTime); | ||
cookie.setAttribute("SameSite", "Lax"); | ||
|
||
return cookie; | ||
} | ||
|
||
public static Cookie typeCookie(String value, long expireTime) { | ||
Cookie cookie = new Cookie("token_type", value); | ||
cookie.setSecure(true); | ||
cookie.setHttpOnly(true); | ||
cookie.setPath("/"); | ||
cookie.setMaxAge((int)expireTime); | ||
cookie.setAttribute("SameSite", "Lax"); | ||
|
||
return cookie; | ||
} | ||
|
||
public static Cookie deleteCookie(Cookie cookie) { | ||
cookie.setMaxAge(0); | ||
cookie.setPath("/"); | ||
return cookie; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule config
updated
from 2b7212 to 2a1a59
Oops, something went wrong.