Skip to content
Snippets Groups Projects
Commit e2ef0a28 authored by Rémi PAILHAREY's avatar Rémi PAILHAREY :fork_knife_plate:
Browse files

fix(auth): SameSite cookie attribute set from Strict to Lax

parent e1a18eba
No related branches found
No related tags found
Loading
Pipeline #15497 passed
......@@ -50,7 +50,7 @@ func (m Manager) HandleOAuth2Login(w http.ResponseWriter, r *http.Request) {
if err != nil {
log.Fatalf("Error generating OAuth2 strate string :%v\n", err)
}
tokens.CreateCookie(oauthStateString, m.Hostname, oAuth2StateKey, 30*time.Second, w)
tokens.CreateCookie(oauthStateString, m.Hostname, oAuth2StateKey, 60*time.Second, w)
url := m.Config.AuthCodeURL(oauthStateString)
http.Redirect(w, r, url, http.StatusTemporaryRedirect)
}
......
......@@ -75,7 +75,7 @@ func CreateCookie(data interface{}, hostName string, cookieName string, duration
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
cookie := http.Cookie{Name: cookieName, Domain: hostName, Value: value, Expires: expiration, Secure: !m.debugMode, HttpOnly: true, SameSite: http.SameSiteStrictMode}
cookie := http.Cookie{Name: cookieName, Domain: hostName, Value: value, Expires: expiration, Secure: !m.debugMode, HttpOnly: true, SameSite: http.SameSiteLaxMode}
http.SetCookie(w, &cookie)
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment