- export auth2.GetTokenInfo

This commit is contained in:
gazebo
2019-03-11 14:50:25 +08:00
parent 7bcf5f228a
commit 4455e51b3f
3 changed files with 22 additions and 2 deletions

View File

@@ -303,8 +303,7 @@ func RemoveUserInfo(token string) {
}
func GetTokenInfo(token string) (authInfo *AuthInfo, err error) {
authInfo = new(AuthInfo)
if err = api.Cacher.GetAs(token, authInfo); err == nil {
if err = api.Cacher.GetAs(token, &authInfo); err == nil {
return authInfo, nil
}
return nil, model.ErrTokenIsInvalid