Browse Source

Merge pull request #1144 from srenatus/sr/support-direct-post-without-get-first

handlers/connector_login: update AuthRequest irregardless of method
pull/1188/head^2
Eric Chiang 8 years ago committed by GitHub
parent
commit
ce686390a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 13
      server/handlers.go

13
server/handlers.go

@ -222,12 +222,9 @@ func (s *Server) handleConnectorLogin(w http.ResponseWriter, r *http.Request) {
}
return
}
scopes := parseScopes(authReq.Scopes)
showBacklink := len(s.connectors) > 1
switch r.Method {
case "GET":
// Set the connector being used for the login.
// Set the connector being used for the login.
if authReq.ConnectorID != connID {
updater := func(a storage.AuthRequest) (storage.AuthRequest, error) {
a.ConnectorID = connID
return a, nil
@ -237,7 +234,13 @@ func (s *Server) handleConnectorLogin(w http.ResponseWriter, r *http.Request) {
s.renderError(w, http.StatusInternalServerError, "Database error.")
return
}
}
scopes := parseScopes(authReq.Scopes)
showBacklink := len(s.connectors) > 1
switch r.Method {
case "GET":
switch conn := conn.Connector.(type) {
case connector.CallbackConnector:
// Use the auth request ID as the "state" token.

Loading…
Cancel
Save