Unverified Commit ce686390 authored by Eric Chiang's avatar Eric Chiang Committed by GitHub

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

handlers/connector_login: update AuthRequest irregardless of method
parents c0bcc819 f013a445
...@@ -222,12 +222,9 @@ func (s *Server) handleConnectorLogin(w http.ResponseWriter, r *http.Request) { ...@@ -222,12 +222,9 @@ func (s *Server) handleConnectorLogin(w http.ResponseWriter, r *http.Request) {
} }
return return
} }
scopes := parseScopes(authReq.Scopes)
showBacklink := len(s.connectors) > 1
switch r.Method { // Set the connector being used for the login.
case "GET": if authReq.ConnectorID != connID {
// Set the connector being used for the login.
updater := func(a storage.AuthRequest) (storage.AuthRequest, error) { updater := func(a storage.AuthRequest) (storage.AuthRequest, error) {
a.ConnectorID = connID a.ConnectorID = connID
return a, nil return a, nil
...@@ -237,7 +234,13 @@ func (s *Server) handleConnectorLogin(w http.ResponseWriter, r *http.Request) { ...@@ -237,7 +234,13 @@ func (s *Server) handleConnectorLogin(w http.ResponseWriter, r *http.Request) {
s.renderError(w, http.StatusInternalServerError, "Database error.") s.renderError(w, http.StatusInternalServerError, "Database error.")
return return
} }
}
scopes := parseScopes(authReq.Scopes)
showBacklink := len(s.connectors) > 1
switch r.Method {
case "GET":
switch conn := conn.Connector.(type) { switch conn := conn.Connector.(type) {
case connector.CallbackConnector: case connector.CallbackConnector:
// Use the auth request ID as the "state" token. // Use the auth request ID as the "state" token.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment