Skip to content

Commit eaa10ec

Browse files
committed
fix: error detection
1 parent 253128c commit eaa10ec

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

server/handlers/authorize.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ func AuthorizeHandler() gin.HandlerFunc {
106106
handleResponse(gc, responseMode, loginURL, redirectURI, loginError, http.StatusOK)
107107
return
108108
}
109+
109110
userID := claims.Subject
110111
user, err := db.Provider.GetUserByID(gc, userID)
111112
if err != nil {
@@ -286,7 +287,7 @@ func validateAuthorizeRequest(responseType, responseMode, clientID, state, codeC
286287

287288
func handleResponse(gc *gin.Context, responseMode, loginURI, redirectURI string, data map[string]interface{}, httpStatusCode int) {
288289
isAuthenticationRequired := false
289-
if _, ok := data["error"]; ok {
290+
if _, ok := data["response"].(map[string]string)["error"]; ok {
290291
isAuthenticationRequired = true
291292
}
292293

0 commit comments

Comments
 (0)