mirror of https://gitee.com/answerdev/answer.git
Merge branch 'fix/0.4.0/user-status' into 'test'
Fix/0.4.0/user status See merge request opensource/answer!247
This commit is contained in:
commit
e47c5a7e26
|
@ -59,6 +59,10 @@ func (as *AuthService) SetUserCacheInfo(ctx context.Context, userInfo *entity.Us
|
|||
return accessToken, err
|
||||
}
|
||||
|
||||
func (as *AuthService) SetUserStatus(ctx context.Context, userInfo *entity.UserCacheInfo) (err error) {
|
||||
return as.authRepo.SetUserStatus(ctx, userInfo.UserID, userInfo)
|
||||
}
|
||||
|
||||
func (as *AuthService) UpdateUserCacheInfo(ctx context.Context, token string, userInfo *entity.UserCacheInfo) (err error) {
|
||||
err = as.authRepo.SetUserCacheInfo(ctx, token, userInfo)
|
||||
if err != nil {
|
||||
|
|
|
@ -416,6 +416,10 @@ func (us *UserService) UserVerifyEmail(ctx context.Context, req *schema.UserVeri
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// User verified email will update user email status. So user status cache should be updated.
|
||||
if err = us.authService.SetUserStatus(ctx, userCacheInfo); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
resp.IsAdmin = userInfo.IsAdmin
|
||||
if resp.IsAdmin {
|
||||
err = us.authService.SetCmsUserCacheInfo(ctx, resp.AccessToken, &entity.UserCacheInfo{UserID: userInfo.ID})
|
||||
|
|
Loading…
Reference in New Issue