Skip to content

Commit af78a4a

Browse files
tronghnthokra-nav
andcommittedMar 20, 2025
always prompt for account picker when logging in
Co-authored-by: Thomas Krampl <thomas.siegfried.krampl@nav.no>
1 parent 05c9d14 commit af78a4a

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed
 

‎internal/auth/authn/handler.go

+1-6
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,7 @@ func (h *handler) Login(w http.ResponseWriter, r *http.Request) {
7676
HttpOnly: true,
7777
})
7878

79-
opts := make([]oauth2.AuthCodeOption, 0)
80-
81-
if prompt := r.URL.Query().Get("prompt"); prompt != "" {
82-
opts = append(opts, oauth2.SetAuthURLParam("prompt", prompt))
83-
}
84-
http.Redirect(w, r, h.oauth2Config.AuthCodeURL(oauthState, opts...), http.StatusFound)
79+
http.Redirect(w, r, h.oauth2Config.AuthCodeURL(oauthState, oauth2.SetAuthURLParam("prompt", "select_account")), http.StatusFound)
8580
}
8681

8782
func (h *handler) Callback(w http.ResponseWriter, r *http.Request) {

0 commit comments

Comments
 (0)