0

I'm trying to create a link to exit a user impersonation session. When the user clicks the exit link, he should get redirected to the admin dashboard and be logged in as himself again.

I have created a link as followed: (This doesn't work as I get an access denied screen because I'm still logged in as that normal user which doesn't have permissions to see the admin dashboard)

<a href="{{ path('AdminBundle_dashboard', {_switch_user: '_exit'}) }}">Exit</a>

But I have also tried creating the link with an absoute link and that works!

<a href="http://domain.com/app_dev.php/admin?_switch_user=_exit">Exit</a>

Although the docs say it should work by using path() http://symfony.com/doc/2.0/book/security.html#impersonating-a-user

Mohammed H
  • 6,880
  • 16
  • 81
  • 127
mattyh88
  • 1,585
  • 5
  • 26
  • 48

0 Answers0