From 8409ac8fe016bcbe997965b662e6a07232f8859c Mon Sep 17 00:00:00 2001 From: Frederic Reisenhauer Date: Tue, 8 Aug 2023 09:58:51 +0200 Subject: [PATCH] use pointer of AuthenticationIncompleteError --- auth/rest.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/auth/rest.go b/auth/rest.go index 5c7cad5..4a9b217 100644 --- a/auth/rest.go +++ b/auth/rest.go @@ -179,7 +179,7 @@ func (a *RestAuthDecorator) RegisterRoutes(mux *httprouter.Router) error { _, _ = rw.Write([]byte(`{"msg":"internal server error"}`)) } - handleIncompleteAuthentication := func(authenticationIncompleteErr AuthenticationIncompleteError, rw http.ResponseWriter) error { + handleIncompleteAuthentication := func(authenticationIncompleteErr *AuthenticationIncompleteError, rw http.ResponseWriter) error { rw.Header().Set("Content-Type", "application/json;charset=utf8") rw.WriteHeader(202) @@ -225,8 +225,8 @@ 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 { + } else if errors.Is(err, &AuthenticationIncompleteError{}) { + if err = handleIncompleteAuthentication(err.(*AuthenticationIncompleteError), rw); err != nil { handleError(err, rw) return }