From afd2b80218c4c03dfbe24a3331caf478a6179588 Mon Sep 17 00:00:00 2001 From: Frederic Reisenhauer Date: Tue, 8 Aug 2023 10:16:08 +0200 Subject: [PATCH] fix authentication incomplete case of authentication handler --- auth/rest.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/auth/rest.go b/auth/rest.go index 4a9b217..bf52d1b 100644 --- a/auth/rest.go +++ b/auth/rest.go @@ -225,11 +225,12 @@ func (a *RestAuthDecorator) RegisterRoutes(mux *httprouter.Router) error { rw.WriteHeader(403) _, _ = rw.Write([]byte(`{"msg":"invalid credentials"}`)) return - } else if errors.Is(err, &AuthenticationIncompleteError{}) { - if err = handleIncompleteAuthentication(err.(*AuthenticationIncompleteError), rw); err != nil { - handleError(err, rw) + } else if errors.Is(err, AuthenticationIncompleteError{}) { + if innerErr := handleIncompleteAuthentication(err.(*AuthenticationIncompleteError), rw); innerErr != nil { + handleError(innerErr, rw) return } + return } else if err != nil || authResponse == nil { handleError(err, rw) return