Skip to content
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
4 changes: 3 additions & 1 deletion api/handler/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func SetJWTCookie(c echo.Context, jwt service.JWT) error {
cookie := new(http.Cookie)
cookie.Name = "StringJWT"
cookie.Value = jwt.Token
// cookie.HttpOnly = true // due the short expiration time it is not needed to be http only
cookie.HttpOnly = true
cookie.Expires = jwt.ExpAt // we want the cookie to expire at the same time as the token
cookie.SameSite = getCookieSameSiteMode()
cookie.Path = "/" // Send cookie in every sub path request
Expand Down Expand Up @@ -60,6 +60,7 @@ func DeleteAuthCookies(c echo.Context) error {
cookie := new(http.Cookie)
cookie.Name = "StringJWT"
cookie.Value = ""
cookie.HttpOnly = true
cookie.Expires = time.Now()
cookie.SameSite = getCookieSameSiteMode()
cookie.Path = "/" // Send cookie in every sub path request
Expand All @@ -69,6 +70,7 @@ func DeleteAuthCookies(c echo.Context) error {
cookie = new(http.Cookie)
cookie.Name = "refresh_token"
cookie.Value = ""
cookie.HttpOnly = true
cookie.Expires = time.Now()
cookie.SameSite = getCookieSameSiteMode()
cookie.Path = "/login/" // Send cookie only in refresh path request
Expand Down