diff --git a/protocol/api/api.go b/protocol/api/api.go index 2b242a82..20cb22b9 100755 --- a/protocol/api/api.go +++ b/protocol/api/api.go @@ -86,6 +86,14 @@ func JWTMiddleware(next http.Handler) http.Handler { return []byte(configure.Config.GetString("jwt.secret")), nil }, SigningMethod: algorithm, + ErrorHandler: func(w http.ResponseWriter, r *http.Request, err string) { + res := &Response{ + w: w, + Status: 403, + Data: err, + } + res.SendJson() + }, }) jwtMiddleware.HandlerWithNext(w, r, next.ServeHTTP)