diff options
Diffstat (limited to 'app/frontend/facades')
-rw-r--r-- | app/frontend/facades/UserFacade.php | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/app/frontend/facades/UserFacade.php b/app/frontend/facades/UserFacade.php index a976af2..0bc5863 100644 --- a/app/frontend/facades/UserFacade.php +++ b/app/frontend/facades/UserFacade.php @@ -160,6 +160,15 @@ class UserFacade extends Facade { } } + public function clearUserAuthKey(DbUser $user) { + if (!$user->IsGuest && $user->DbRecord && $user->AuthKey) { + $keyRecord = UserAuthKey::finder()->findByAuthKey($user->AuthKey); + if ($keyRecord && $keyRecord->UserID == $user->DbRecord->ID) { + $keyRecord->delete(); + } + } + } + } ?> |