Skip to content

Commit

Permalink
handlers/auth: don't display backlink when passing backlink=none
Browse files Browse the repository at this point in the history
Signed-off-by: Stephan Renatus <[email protected]>
  • Loading branch information
srenatus committed Dec 4, 2017
1 parent 1e82ba5 commit e8fe811
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions server/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -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":
Expand Down

0 comments on commit e8fe811

Please sign in to comment.