diff --git a/server/handlers.go b/server/handlers.go
index 926b4000097a81c1dd0015b41d3fa42ddffa2103..d36c55bcfb506b020a4ba11b4ecd5fd42ed1d2cf 100644
--- a/server/handlers.go
+++ b/server/handlers.go
@@ -222,22 +222,23 @@ func (s *Server) handleConnectorLogin(w http.ResponseWriter, r *http.Request) {
 		}
 		return
 	}
+
+	// Set the connector being used for the login.
+	updater := func(a storage.AuthRequest) (storage.AuthRequest, error) {
+		a.ConnectorID = connID
+		return a, nil
+	}
+	if err := s.storage.UpdateAuthRequest(authReqID, updater); err != nil {
+		s.logger.Errorf("Failed to set connector ID on auth request: %v", err)
+		s.renderError(w, http.StatusInternalServerError, "Database error.")
+		return
+	}
+
 	scopes := parseScopes(authReq.Scopes)
 	showBacklink := len(s.connectors) > 1
 
 	switch r.Method {
 	case "GET":
-		// Set the connector being used for the login.
-		updater := func(a storage.AuthRequest) (storage.AuthRequest, error) {
-			a.ConnectorID = connID
-			return a, nil
-		}
-		if err := s.storage.UpdateAuthRequest(authReqID, updater); err != nil {
-			s.logger.Errorf("Failed to set connector ID on auth request: %v", err)
-			s.renderError(w, http.StatusInternalServerError, "Database error.")
-			return
-		}
-
 		switch conn := conn.Connector.(type) {
 		case connector.CallbackConnector:
 			// Use the auth request ID as the "state" token.