Thursday, May 2, 2013

Bug on Manually Login with AuthComponent

Hi, people!

I'm doing a manual login action, where i find the user based on your username (findByUsername).

If the user exists, i want to force login the user to the AuthComponent. Else, i register the user (success).

When i try to force the login of the user, i have a some kind of bug:

I try to login like this:

$this->Auth->login($user_exists['User']);

Where $user_exists['User'] contains all the User array with all the user data from the findByUsername.

After the $this->Auth->login(), i can debug, for example, AuthComponent::user().

But when i redirect the user to another action, the Auth seems not to work. Its like the manual login doesn't worked, and the user is redirected to the login action again.

Someone knows what i doing wrong?

I will be very prettyful for some help. :)

Thanks for my possible bad english!

Cheers,
@luizhrqas.

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments: