mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-06 04:15:46 +08:00
Set the token activity time to five minutes ago
This commit is contained in:
parent
073b6d200a
commit
5e3a3c61f3
@ -101,25 +101,22 @@ func GetClaimFromToken(tokensString string) (*Claims, error) {
|
||||
if err != nil {
|
||||
if ve, ok := err.(*jwt.ValidationError); ok {
|
||||
if ve.Errors&jwt.ValidationErrorMalformed != 0 {
|
||||
return nil, constant.ErrTokenMalformed
|
||||
return nil, utils.Wrap(constant.ErrTokenMalformed, "")
|
||||
} else if ve.Errors&jwt.ValidationErrorExpired != 0 {
|
||||
return nil, constant.ErrTokenExpired
|
||||
return nil, utils.Wrap(constant.ErrTokenExpired, "")
|
||||
} else if ve.Errors&jwt.ValidationErrorNotValidYet != 0 {
|
||||
log.Error("", "ParseToken failed, ", err.Error(), token)
|
||||
return nil, nil
|
||||
// return nil, constant.ErrTokenNotValidYet
|
||||
return nil, utils.Wrap(constant.ErrTokenNotValidYet, "")
|
||||
} else {
|
||||
return nil, constant.ErrTokenUnknown
|
||||
return nil, utils.Wrap(constant.ErrTokenUnknown, "")
|
||||
}
|
||||
} else {
|
||||
return nil, constant.ErrTokenNotValidYet
|
||||
return nil, utils.Wrap(constant.ErrTokenNotValidYet, "")
|
||||
}
|
||||
} else {
|
||||
if claims, ok := token.Claims.(*Claims); ok && token.Valid {
|
||||
//log.NewDebug("", claims.UID, claims.Platform)
|
||||
return claims, nil
|
||||
}
|
||||
return nil, constant.ErrTokenNotValidYet
|
||||
return nil, utils.Wrap(constant.ErrTokenNotValidYet, "")
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user