Skip to content
This repository has been archived by the owner on Jul 30, 2024. It is now read-only.

Commit

Permalink
use pointer of AuthenticationIncompleteError
Browse files Browse the repository at this point in the history
  • Loading branch information
freisenhauer-mittwald committed Aug 8, 2023
1 parent 1f421ba commit 8409ac8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions auth/rest.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 8409ac8

Please sign in to comment.