1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-05 23:44:03 +00:00

Merge branch 'master' of github.com:archtechx/tenancy into unware-feature

This commit is contained in:
lukinovec 2023-02-23 15:12:59 +01:00
commit b0560331ed
87 changed files with 2308 additions and 533 deletions

View file

@ -48,11 +48,26 @@ class UserImpersonation implements Feature
$token->delete();
session()->put('tenancy_impersonating', true);
return redirect($token->redirect_url);
}
public static function alwaysBootstrap(): bool
{
return false;
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');
}
}