mirror of
https://forgejo.merr.is/annika/jwtauth.git
synced 2025-12-11 13:47:41 -05:00
Added stricter check for edge-case when token is nil
This commit is contained in:
parent
293f48cc84
commit
fde476f0a7
1 changed files with 1 additions and 1 deletions
|
|
@ -117,7 +117,7 @@ func (ja *JwtAuth) Verify(paramAliases ...string) func(chi.Handler) chi.Handler
|
|||
return
|
||||
}
|
||||
|
||||
if !token.Valid || token.Method != ja.signer {
|
||||
if token == nil || !token.Valid || token.Method != ja.signer {
|
||||
err = ErrUnauthorized
|
||||
ctx = ja.SetContext(ctx, token, err)
|
||||
next.ServeHTTPC(ctx, w, r)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue