From b7fb7d93a351ce4c7b5f9c27b074f29e16f1c276 Mon Sep 17 00:00:00 2001 From: nobuyo <longzechangsheng@gmail.com> Date: Mon, 30 Jan 2023 22:54:41 +0900 Subject: [PATCH] Revert back personal tasted changes Signed-off-by: nobuyo <longzechangsheng@gmail.com> --- server/handlers.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/handlers.go b/server/handlers.go index 51d147c5..f25d52f5 100755 --- a/server/handlers.go +++ b/server/handlers.go @@ -494,7 +494,7 @@ func (s *Server) handleConnectorCallback(w http.ResponseWriter, r *http.Request) // finalizeLogin associates the user's identity with the current AuthRequest, then returns // the approval page's path. -func (s *Server) finalizeLogin(identity connector.Identity, authReq storage.AuthRequest, conn connector.Connector) (returnURL string, canSkipApproval bool, err error) { +func (s *Server) finalizeLogin(identity connector.Identity, authReq storage.AuthRequest, conn connector.Connector) (string, bool, error) { claims := storage.Claims{ UserID: identity.UserID, Username: identity.Username, @@ -510,7 +510,7 @@ func (s *Server) finalizeLogin(identity connector.Identity, authReq storage.Auth a.ConnectorData = identity.ConnectorData return a, nil } - if err = s.storage.UpdateAuthRequest(authReq.ID, updater); err != nil { + if err := s.storage.UpdateAuthRequest(authReq.ID, updater); err != nil { return "", false, fmt.Errorf("failed to update auth request: %v", err) } @@ -533,7 +533,7 @@ func (s *Server) finalizeLogin(identity connector.Identity, authReq storage.Auth h.Write([]byte(authReq.ID)) mac := h.Sum(nil) - returnURL = path.Join(s.issuerURL.Path, "/approval") + "?req=" + authReq.ID + "&hmac=" + base64.RawURLEncoding.EncodeToString(mac) + returnURL := path.Join(s.issuerURL.Path, "/approval") + "?req=" + authReq.ID + "&hmac=" + base64.RawURLEncoding.EncodeToString(mac) _, ok := conn.(connector.RefreshConnector) if !ok { return returnURL, false, nil -- GitLab