update: banned user remove session

This commit is contained in:
v2board
2023-02-03 23:39:31 +08:00
parent 10861856b5
commit 2429ff6d58
3 changed files with 14 additions and 2 deletions

View File

@ -84,7 +84,7 @@ class AuthService
return (array)Cache::get(CacheKey::get("USER_SESSIONS", $this->user->id), []);
}
public function delSession($sessionId)
public function removeSession($sessionId)
{
$cacheKey = CacheKey::get("USER_SESSIONS", $this->user->id);
$sessions = (array)Cache::get($cacheKey, []);
@ -95,4 +95,10 @@ class AuthService
)) return false;
return true;
}
public function removeAllSession()
{
$cacheKey = CacheKey::get("USER_SESSIONS", $this->user->id);
return Cache::forget($cacheKey);
}
}