From dc56e5c95e0003bc62c9b9b4c4a33693eab35c99 Mon Sep 17 00:00:00 2001 From: tabuna Date: Thu, 2 Nov 2023 00:48:07 +0300 Subject: [PATCH] refs #2723 Changed type model class to interface --- src/Access/Impersonation.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Access/Impersonation.php b/src/Access/Impersonation.php index 3ac65d7c7..de68f3f58 100644 --- a/src/Access/Impersonation.php +++ b/src/Access/Impersonation.php @@ -5,7 +5,6 @@ namespace Orchid\Access; use Illuminate\Contracts\Auth\Authenticatable; -use Illuminate\Foundation\Auth\User; use Illuminate\Support\Facades\Auth; class Impersonation @@ -16,11 +15,11 @@ class Impersonation /** * Changes the current authenticated user to the given user. * - * @param User $user The user to switch to + * @param Authenticatable $user The user to switch to * * @return void */ - public static function loginAs(User $user): void + public static function loginAs(Authenticatable $user): void { // Store the original authenticated user ID in the session if it's not already there if (! session()->has(self::SESSION_NAME)) { @@ -28,7 +27,7 @@ public static function loginAs(User $user): void } // Log in the given user - self::getAuth()->loginUsingId($user->getKey()); + self::getAuth()->loginUsingId($user->getAuthIdentifier()); } /**