1
0
mirror of https://github.com/go-kratos/kratos.git synced 2026-05-22 10:15:24 +02:00

fix: 'tokenInfo' might have 'nil' or bad value (#1534)

* fix: 'tokenInfo' might have 'nil' or bad value

* fix: return the origin err
This commit is contained in:
Bear
2021-10-06 13:06:31 +08:00
committed by GitHub
parent 0597883e70
commit 5e88a20cd4
+1
View File
@@ -93,6 +93,7 @@ func Server(keyFunc jwt.Keyfunc, opts ...Option) middleware.Middleware {
return nil, ErrTokenParseFail
}
}
return nil, errors.Unauthorized("UNAUTHORIZED", err.Error())
} else if !tokenInfo.Valid {
return nil, ErrTokenInvalid
} else if tokenInfo.Method != o.signingMethod {