From e8fe811dfd963034886d181f9c71fff52aa36b42 Mon Sep 17 00:00:00 2001 From: Stephan Renatus Date: Mon, 4 Dec 2017 16:06:33 +0100 Subject: [PATCH] handlers/auth: don't display backlink when passing backlink=none Signed-off-by: Stephan Renatus --- server/handlers.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/server/handlers.go b/server/handlers.go index a8f22ad145..d11d12ef4a 100644 --- a/server/handlers.go +++ b/server/handlers.go @@ -169,7 +169,7 @@ func (s *Server) handleAuthorization(w http.ResponseWriter, r *http.Request) { // if we already know which connector the user should use -- go there directly if authReq.ConnectorID != "" { - http.Redirect(w, r, s.absPath("/auth", authReq.ConnectorID)+"?req="+authReq.ID, http.StatusFound) + http.Redirect(w, r, s.absPath("/auth", authReq.ConnectorID)+"?backlink=none&req="+authReq.ID, http.StatusFound) return } @@ -229,7 +229,12 @@ func (s *Server) handleConnectorLogin(w http.ResponseWriter, r *http.Request) { return } scopes := parseScopes(authReq.Scopes) - showBacklink := len(s.connectors) > 1 + + // allows for overriding the backlink display -- this is set when the initial + // request provided an `id_token_hint`, and we've forwarded the client based + // on this token's connector id. + backlinkOverride := r.FormValue("backlink") + showBacklink := len(s.connectors) > 1 && backlinkOverride != "none" switch r.Method { case "GET":