mirror of
https://forgejo.merr.is/annika/jwtauth.git
synced 2025-12-11 11:16:32 -05:00
Merge pull request #24 from go-chi/err_notoken
Add ErrNoTokenFound verify error
This commit is contained in:
commit
5d94d7c263
1 changed files with 4 additions and 0 deletions
|
|
@ -19,6 +19,7 @@ var (
|
|||
var (
|
||||
ErrUnauthorized = errors.New("jwtauth: token is unauthorized")
|
||||
ErrExpired = errors.New("jwtauth: token is expired")
|
||||
ErrNoTokenFound = errors.New("jwtauth: no token found")
|
||||
)
|
||||
|
||||
type JWTAuth struct {
|
||||
|
|
@ -97,6 +98,9 @@ func VerifyRequest(ja *JWTAuth, r *http.Request, findTokenFns ...func(r *http.Re
|
|||
break
|
||||
}
|
||||
}
|
||||
if tokenStr == "" {
|
||||
return nil, ErrNoTokenFound
|
||||
}
|
||||
|
||||
// TODO: what other kinds of validations should we do / error messages?
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue