mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 19:54:04 +00:00
wip
This commit is contained in:
parent
7d3298c6bb
commit
55482a0726
2 changed files with 54 additions and 0 deletions
|
|
@ -48,6 +48,23 @@ class UserImpersonation implements Feature
|
|||
|
||||
$token->delete();
|
||||
|
||||
session()->put('tenancy_impersonation', true);
|
||||
|
||||
return redirect($token->redirect_url);
|
||||
}
|
||||
|
||||
public static function isImpersonating(): bool
|
||||
{
|
||||
return session()->has('tenancy_impersonation');
|
||||
}
|
||||
|
||||
/**
|
||||
* Logout and forget session
|
||||
*/
|
||||
public static function stop(): void
|
||||
{
|
||||
auth()->logout();
|
||||
|
||||
session()->forget('tenancy_impersonation');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue