Archived
1
0
Fork 0

app/library/Auth.php: Fix typo.

This commit is contained in:
Henrik Hautakoski 2023-04-30 18:03:23 +02:00
parent 2c038dc9f7
commit 793eb826df

View file

@ -10,7 +10,7 @@ use App\Model\Data\User,
class Auth extends Injectable
{
const SESSION_KEY = 'auth';
const IMPERSONATEOR_ID = 'auth.impersonateor';
const IMPERSONATOR_ID = 'auth.impersonator';
/**
* Login using email/user + password combination.
@ -104,14 +104,14 @@ class Auth extends Injectable
throw new \DomainException("Can't impersonate yourself");
}
$this->session->set(self::IMPERSONATEOR_ID, $current->getId());
$this->session->set(self::IMPERSONATOR_ID, $current->getId());
$this->setIdentity($user->getId());
$this->eventsManager->fire('auth:onImpersonate', $this, $current);
}
public function impersonateClear($imp_id)
{
$this->session->remove(self::IMPERSONATEOR_ID);
$this->session->remove(self::IMPERSONATOR_ID);
$this->session->set(self::SESSION_KEY, $imp_id);
}
@ -164,7 +164,7 @@ class Auth extends Injectable
*/
public function clearIdentity()
{
$imp_id = $this->session->get(self::IMPERSONATEOR_ID);
$imp_id = $this->session->get(self::IMPERSONATOR_ID);
if ($imp_id !== null) {
$this->impersonateClear($imp_id);
} else {