mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-13 19:24:03 +00:00
Merge branch 'master' of github.com:archtechx/tenancy
This commit is contained in:
commit
a0256fd5f3
20 changed files with 285 additions and 34 deletions
|
|
@ -48,6 +48,23 @@ class UserImpersonation implements Feature
|
|||
|
||||
$token->delete();
|
||||
|
||||
session()->put('tenancy_impersonating', true);
|
||||
|
||||
return redirect($token->redirect_url);
|
||||
}
|
||||
|
||||
public static function isImpersonating(): bool
|
||||
{
|
||||
return session()->has('tenancy_impersonating');
|
||||
}
|
||||
|
||||
/**
|
||||
* Logout from the current domain and forget impersonation session.
|
||||
*/
|
||||
public static function leave(): void // todo possibly rename
|
||||
{
|
||||
auth()->logout();
|
||||
|
||||
session()->forget('tenancy_impersonating');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue