Skip to content

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