-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Impersonate From Within App #73
Comments
I'm not sure what exactly the issue, can you create a github repo? |
Well I don't think it's necessary. I just want to use the impersonate routes of this package manually from my app instead of from within nova. Maybe I have just overseen something, as couldn't find how to call the routes. |
The routes protected by You can re-use the controller if you want https://github.com/KABBOUCHI/nova-impersonate/blob/master/src/Http/Controllers/ImpersonateController.php or you can do ur own logic: $manager = app('impersonate');
// Check if Impersonating
$manager->isImpersonating()
// Impersonate
$manager->take(auth()->user(), $user_to_impersonate);
// Leave
$manager->leave()
|
Thank you! I am still wondering if there is a built-in way to register the routes, but it doesn't matter that much anyway. I just created my own routes and used your controller, which works fine. |
Thank you for this great package. We use it all the time ;)
But now I would like to add some impersonation shortcuts directly to our app, because we often need to impersonate as the same user.
And I wonder what's the best way to do this.
I know this package is a nova package, so this isn't a use case its made for.
But I had quite a hard time understanding how this behaves in conjunction with the underlying 404labfr/laravel-impersonate package.
However I have come to an almost satisfying result:
Route::impersonate()
This way I can impersonate via the link and I am redirected to the app as the impersonated user with the reverse panel displayed exactly like it would behave if I had impersonated through nova.
But the problem lies in the detail. I would like to use the reverse panel and redirect to the same page, or at least the app home instead of nova. But since my link uses the other controller route, the redirect session cookie is not properly set.
How could I do that?
I guess this is related to #63 (comment), because if I could just use the nova-impersonate routes everything should work fine.
The text was updated successfully, but these errors were encountered: