I want to redirect people direct after login. How?
Hello Community! I am the new guy and I have a question.
my Version of Vanilla: 2.1b2
How do I redirect people after login?
I tried to handle with the controllers but I can't get to any solution.
I want to let the people log into my forum and after that they should get directly redirected to an other page outside of vanilla.
It would be good if you guys could help me out of this...
If you need more information please ask
oh... and i would love to use the search function first... but its broken
Best Answer
-
hgtonight MVP
Welcome!
The entry controller (which is the controller that handles logging in) supports setting a redirection via the target. So, create a simple plugin, hook into the Entry Controller, handle the After Sign In event, set the target to what you want, and watch the magic happen.
Some sample code:
public function EntryController_AfterSignIn_Handler($Sender) { $Sender->Target('http://www.example.com'); }
The only gotcha with this scenario would be redirecting to another domain. If you want to do that, you have to add the domain to the trusted domain config option.
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
5
Answers
Hi new guy! I cannot help you with your redirection question, but at least I can show you how to search if that question has been asked before: www.google.de/#q=site:vanillaforums.org+redirect+login
Thank you! But it only shows threads i've already found
Welcome!
The entry controller (which is the controller that handles logging in) supports setting a redirection via the target. So, create a simple plugin, hook into the Entry Controller, handle the After Sign In event, set the target to what you want, and watch the magic happen.
Some sample code:
The only gotcha with this scenario would be redirecting to another domain. If you want to do that, you have to add the domain to the trusted domain config option.
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
Thank you @hgtonight !
I tried with something like "$Sender->RedirectUrl('...')" the whole time... Now anything is fine