Skip to content

v1.0.2-alpha #85

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions api/handler/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func SetJWTCookie(c echo.Context, jwt service.JWT) error {
cookie.Value = jwt.Token
// cookie.HttpOnly = true // due the short expiration time it is not needed to be http only
cookie.Expires = jwt.ExpAt // we want the cookie to expire at the same time as the token
cookie.SameSite = http.SameSiteLaxMode
cookie.SameSite = http.SameSiteNoneMode
cookie.Path = "/" // Send cookie in every sub path request
cookie.Secure = !IsLocalEnv() // in production allow https only
c.SetCookie(cookie)
Expand All @@ -70,7 +70,7 @@ func SetRefreshTokenCookie(c echo.Context, refresh service.RefreshTokenResponse)
cookie.Value = refresh.Token
cookie.HttpOnly = true
cookie.Expires = refresh.ExpAt // we want the cookie to expire at the same time as the token
cookie.SameSite = http.SameSiteLaxMode
cookie.SameSite = http.SameSiteNoneMode
cookie.Path = "/login/" // Send cookie only in /login path request
cookie.Secure = !IsLocalEnv() // in production allow https only
c.SetCookie(cookie)
Expand Down Expand Up @@ -107,7 +107,7 @@ func DeleteAuthCookies(c echo.Context) error {
cookie.Name = "refresh_token"
cookie.Value = ""
cookie.Expires = time.Now()
cookie.SameSite = http.SameSiteLaxMode
cookie.SameSite = http.SameSiteNoneMode
cookie.Path = "/login/" // Send cookie only in refresh path request
cookie.Secure = !IsLocalEnv()
c.SetCookie(cookie)
Expand Down