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
Branches
No related tags found
3 merge requests!14feat: addprices + subject managment,!11feat: Add partners issue info,!5Feat: Add backoffice
Pipeline #15497 passed
...@@ -50,7 +50,7 @@ func (m Manager) HandleOAuth2Login(w http.ResponseWriter, r *http.Request) { ...@@ -50,7 +50,7 @@ func (m Manager) HandleOAuth2Login(w http.ResponseWriter, r *http.Request) {
if err != nil { if err != nil {
log.Fatalf("Error generating OAuth2 strate string :%v\n", err) 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) url := m.Config.AuthCodeURL(oauthStateString)
http.Redirect(w, r, url, http.StatusTemporaryRedirect) http.Redirect(w, r, url, http.StatusTemporaryRedirect)
} }
......
...@@ -75,7 +75,7 @@ func CreateCookie(data interface{}, hostName string, cookieName string, duration ...@@ -75,7 +75,7 @@ func CreateCookie(data interface{}, hostName string, cookieName string, duration
http.Error(w, err.Error(), http.StatusInternalServerError) http.Error(w, err.Error(), http.StatusInternalServerError)
return 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) 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