diff --git a/internal/auth/oauth2.go b/internal/auth/oauth2.go index d7b5aff56eaa3ab6ddac7c5afa4b8a1d8dd969ec..870b2dee6acb81fd25308d0aac196b7f88b825cf 100644 --- a/internal/auth/oauth2.go +++ b/internal/auth/oauth2.go @@ -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) } diff --git a/internal/tokens/tokens.go b/internal/tokens/tokens.go index 287e92500704fbf8b050f88e80797ff23a0ddaae..c22225fedaeba53c9f763846056c887bf90c1ea3 100644 --- a/internal/tokens/tokens.go +++ b/internal/tokens/tokens.go @@ -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) }