1
0
mirror of https://github.com/go-kratos/kratos.git synced 2025-01-26 03:52:12 +02:00

feat: jwt KeyFunc external return (#2809)

* Update jwt.go

* Update jwt.go
This commit is contained in:
Bin 2023-05-04 17:15:36 +08:00 committed by GitHub
parent 520b321fe9
commit aed172b8dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -114,6 +114,9 @@ func Server(keyFunc jwt.Keyfunc, opts ...Option) middleware.Middleware {
if ve.Errors&(jwt.ValidationErrorExpired|jwt.ValidationErrorNotValidYet) != 0 {
return nil, ErrTokenExpired
}
if ve.Inner != nil {
return nil, ve.Inner
}
return nil, ErrTokenParseFail
}
if !tokenInfo.Valid {