From eaa10ec5bc0b6d071fcdd16c09fc313b334b8a23 Mon Sep 17 00:00:00 2001 From: Lakhan Samani Date: Tue, 18 Oct 2022 22:34:57 +0530 Subject: [PATCH] fix: error detection --- server/handlers/authorize.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/handlers/authorize.go b/server/handlers/authorize.go index 805912d..a550a06 100644 --- a/server/handlers/authorize.go +++ b/server/handlers/authorize.go @@ -106,6 +106,7 @@ func AuthorizeHandler() gin.HandlerFunc { handleResponse(gc, responseMode, loginURL, redirectURI, loginError, http.StatusOK) return } + userID := claims.Subject user, err := db.Provider.GetUserByID(gc, userID) if err != nil { @@ -286,7 +287,7 @@ func validateAuthorizeRequest(responseType, responseMode, clientID, state, codeC func handleResponse(gc *gin.Context, responseMode, loginURI, redirectURI string, data map[string]interface{}, httpStatusCode int) { isAuthenticationRequired := false - if _, ok := data["error"]; ok { + if _, ok := data["response"].(map[string]string)["error"]; ok { isAuthenticationRequired = true }