Adding logout and loginUsingId methods on the sentinal guard

parent 5341a865
......@@ -80,8 +80,32 @@ class Sentinel implements LaravelGuard
$this->setUser($user);
}
/**
* @param array $credentials
* @param bool $remember
* @return bool
*/
public function attempt(array $credentials, $remember = false)
{
return SentinelFacade::authenticate($credentials, $remember);
}
/**
* @return bool
*/
public function logout()
{
return SentinelFacade::logout();
}
/**
* @param int $userId
* @return bool
*/
public function loginUsingId($userId)
{
$impersonatedUser = app(\Modules\User\Repositories\UserRepository::class)->find($userId);
return $this->login($impersonatedUser);
}
}
url: https://github.com/AsgardCms/Platform
versions:
"2.x.x@unreleased":
added:
- New methods on the Sentinel Guard, <code>logout</code> and <code>loginUsingId</code>
"2.5.0":
added:
- Trigger an event (<code>UserIsUpdating</code>) before a user is updated
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment