Raggiunto primo stato presentabile
This commit is contained in:
+4
-4
@@ -49,7 +49,7 @@ type AuthService struct {
|
||||
UserFromSessionToken func(session string) (string, error)
|
||||
|
||||
// AuthenticationFailed handles failed authentications
|
||||
AuthenticationFailed http.Handler
|
||||
AuthenticationFailed func(error) http.Handler
|
||||
|
||||
// OtherError handles other errors
|
||||
OtherError func(error) http.Handler
|
||||
@@ -57,7 +57,7 @@ type AuthService struct {
|
||||
|
||||
func (auth *AuthService) Login(w http.ResponseWriter, r *http.Request, userID, password string) {
|
||||
if err := auth.CheckUserPassword(userID, password); err != nil {
|
||||
auth.AuthenticationFailed.ServeHTTP(w, r)
|
||||
auth.AuthenticationFailed(err).ServeHTTP(w, r)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ func (auth *AuthService) Middleware(config *AuthMiddlewareConfig) func(http.Hand
|
||||
return
|
||||
}
|
||||
|
||||
auth.AuthenticationFailed.ServeHTTP(w, r)
|
||||
auth.AuthenticationFailed(err).ServeHTTP(w, r)
|
||||
return
|
||||
}
|
||||
if err != nil {
|
||||
@@ -139,7 +139,7 @@ func (auth *AuthService) Middleware(config *AuthMiddlewareConfig) func(http.Hand
|
||||
}
|
||||
|
||||
if !hasAll {
|
||||
auth.AuthenticationFailed.ServeHTTP(w, r)
|
||||
auth.AuthenticationFailed(err).ServeHTTP(w, r)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user