mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 16:54:05 +00:00
Update UserImpersonation.php
This PR adds a new session value `tenancy_impersonated_by` in the tenant scope when you are impersonating a tenant. This is similar to how Laravel Nova adds the `nova_impersonated_by` session value and could be used to identify when you are impersonating, who is impersonating. This may be useful for additional application logic and UI niceties such as an impersonation banner.
This commit is contained in:
parent
747c192979
commit
45e0aad091
1 changed files with 4 additions and 0 deletions
|
|
@ -53,6 +53,10 @@ class UserImpersonation implements Feature
|
||||||
|
|
||||||
$token->delete();
|
$token->delete();
|
||||||
|
|
||||||
|
session()->put(
|
||||||
|
'tenancy_impersonated_by', Auth::user()?->getAuthIdentifier()
|
||||||
|
);
|
||||||
|
|
||||||
return redirect($token->redirect_url);
|
return redirect($token->redirect_url);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue