I have not used Symfony2 at all yet, but in symfony 1.x, all you had to
do was $this->getUser()->setAuthenticated(true); and they were
authenticated.
The best way to lead up to that point is create a unique code (maybe
using md5(microtime()) ) and store that against the users account in the
database. When you send the email, add that unique code to the link you
send him (i.e.
http://mysite.com/users/login/autocode/RANDOM_CODE_HERE/username/USERNAME).
When he clicks the link, you can then compare his username to the code
you generated, then remove the code from the database and use
$this->getUser()->setAuthenticated(true) using the Symfony2 equivalent.
On 07/03/2011 20:18, Brandon wrote:
I'm loving Symfony2, but I'm a newbie.
I have a form-login security function that is working great. But when
a new user registers they are sent an email confirmation link, and it
would be a little wonky to send them to the login page after
registering. How do I log them in after they click the confirmation
link?
And for various reasons I would much prefer to build this on my own
instead of the FOS bundle (even though it's great, wow!)
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-project.com
You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en