From cba2ec8e5a50cc2afbe232df3be258b8a31ecb3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklaus=20K=C3=BClling?= Date: Fri, 8 May 2026 16:52:43 +0200 Subject: [PATCH] fix(oauth): Replace prompt=consent with prompt=login --- internal/webserver/authentication/oauth/Oauth.go | 2 +- internal/webserver/authentication/oauth/Oauth_test.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/webserver/authentication/oauth/Oauth.go b/internal/webserver/authentication/oauth/Oauth.go index 93551d8b..0134dc9d 100644 --- a/internal/webserver/authentication/oauth/Oauth.go +++ b/internal/webserver/authentication/oauth/Oauth.go @@ -53,7 +53,7 @@ func initLogin(w http.ResponseWriter, r *http.Request, showConsentScreen bool) { setCallbackCookie(w, state) prompt := "none" if showConsentScreen { - prompt = "consent" + prompt = "login" } http.Redirect(w, r, config.AuthCodeURL(state)+"&prompt="+prompt, http.StatusFound) } diff --git a/internal/webserver/authentication/oauth/Oauth_test.go b/internal/webserver/authentication/oauth/Oauth_test.go index d72d7fe2..2f583e1f 100644 --- a/internal/webserver/authentication/oauth/Oauth_test.go +++ b/internal/webserver/authentication/oauth/Oauth_test.go @@ -241,7 +241,7 @@ func TestHandlerLogin(t *testing.T) { test.IsEqualInt(t, rr.Code, http.StatusFound) location := rr.Header().Get("Location") test.IsNotEmpty(t, location) - test.IsEqualBool(t, containsString(location, "prompt=consent"), true) + test.IsEqualBool(t, containsString(location, "prompt=login, true) test.IsEqualBool(t, len(rr.Result().Cookies()) > 0, true) }) } @@ -273,7 +273,7 @@ func TestHandlerCallback_LoginRequired(t *testing.T) { // Should re-initiate login with consent test.IsEqualInt(t, rr.Code, http.StatusFound) - test.IsEqualBool(t, containsString(rr.Header().Get("Location"), "prompt=consent"), true) + test.IsEqualBool(t, containsString(rr.Header().Get("Location"), "prompt=login, true) }) } }