Skip to content
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

Redirect url feature #172

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

cardei
Copy link

@cardei cardei commented Nov 11, 2022

It is a small improvement that will permit to pass a redirection url when it is needed.
To pass a url different from the used in config file:

Use Session::put('imp_back_url', 'CUSTOM_URL');

before impersonate

Example of use before impersonate:

if($request->back_url){
      $request->session()->put('imp_back_url', $request->back_url);
}

return redirect(route('impersonate', $request->user_id));

This session imp_back_url will be cleared when user leave impersonate.

With this small improvement it is posible to pass custom redirection url when needed or use default from config if it's not passed trough session.

It is working fine and solved my needs.
I hope it's make sense.

@cardei
Copy link
Author

cardei commented Nov 11, 2022

It will be nice to have this in the main repository 😉

@SkyspotEmil
Copy link

This is a nice feature that i have wanted for some time :) Instead of doing it directly in the ImpersonateController I think it would be prettier to do it in the ImpersonateManager

@MarceauKa what is needed for this to be merged into master?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants