refactor: try to decode the token claim for pre-verification
This commit is contained in:
parent
16f2ac3604
commit
d1d4f6b679
|
@ -168,7 +168,14 @@ func Logout(token string) error {
|
|||
}
|
||||
|
||||
func VerifyLoginToken(token string) error {
|
||||
_, err := jwt.Decode([]byte(token))
|
||||
uvt, err := jwt.Decode([]byte(token))
|
||||
if err != nil {
|
||||
return ErrInvalidToken
|
||||
}
|
||||
|
||||
var claim jwt.Claims
|
||||
|
||||
err = uvt.Claims(&claim)
|
||||
if err != nil {
|
||||
return ErrInvalidToken
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue