From 3d9e45de874d2365f282cbf75a0151c01c2f9b90 Mon Sep 17 00:00:00 2001 From: BapiGso <59081856+BapiGso@users.noreply.github.com> Date: Thu, 12 Oct 2023 13:38:45 +0800 Subject: [PATCH] Fix bug where config.ContinueOnIgnoredError does not take effect when set to true --- jwt.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jwt.go b/jwt.go index 1e97d30..e34a273 100644 --- a/jwt.go +++ b/jwt.go @@ -246,11 +246,11 @@ func (config Config) ToMiddleware() (echo.MiddlewareFunc, error) { } else if lastExtractorErr != nil { err = &TokenExtractionError{Err: lastExtractorErr} } + if config.ContinueOnIgnoredError { + return next(c) + } if config.ErrorHandler != nil { tmpErr := config.ErrorHandler(c, err) - if config.ContinueOnIgnoredError && tmpErr == nil { - return next(c) - } return tmpErr }