This commit is contained in:
@@ -78,6 +78,23 @@ func (l *DeleteAccountLogic) DeleteAccountAll() (resp *types.DeleteAccountRespon
|
||||
|
||||
l.clearAllSessions(currentUser.Id)
|
||||
|
||||
// Kick all affected family member devices + clear their sessions
|
||||
for _, memberUserID := range affectedUserIDs {
|
||||
if memberUserID == currentUser.Id {
|
||||
continue
|
||||
}
|
||||
var memberDevices []user.Device
|
||||
l.svcCtx.DB.WithContext(l.ctx).
|
||||
Model(&user.Device{}).
|
||||
Where("user_id = ?", memberUserID).
|
||||
Find(&memberDevices)
|
||||
|
||||
for _, d := range memberDevices {
|
||||
l.svcCtx.DeviceManager.KickDevice(d.UserId, d.Identifier)
|
||||
}
|
||||
l.clearAllSessions(memberUserID)
|
||||
}
|
||||
|
||||
// 主动清 auth method 相关缓存(含 email/mobile 等 key),避免缓存未命中时无法生成正确 key
|
||||
if len(authMethods) > 0 {
|
||||
var authCacheKeys []string
|
||||
|
||||
Reference in New Issue
Block a user