Everything looks ok. And I guess something as follow:
1.
Is your users table has both username and password fields.

2.
How about the hash password stored after registration action.

3.
Try this code in Users::login action, you should remove comment at
//print_r($user) for debug


if(!empty($this->data))
        {
$user = $this->Auth->user();
//$user = false;
            if($user){
//print_r($user);
                $this->redirect('/', null, true);
}
            $this->Session->setFlash("Check your account");

---------------------------------
Best regards !
Giang Son Dat
Mobile: +84 988114164
Email [email protected], [email protected]


On Tue, Feb 10, 2009 at 11:38 PM, Dcahrakos <[email protected]> wrote:

>
> oops, sorry, was in a rush to leave for work didnt have time to post
> it.
>
> The login function is empty, which according to the docs on the auth
> component, thats the way its supposed to be since auth does it all.
>
> my config for auth in the AppController is:
>
>    var $components = array('Auth');
>
>            function beforeFilter() {
>
>                $this->Auth->loginAction = array('controller' => 'users',
> 'action' => 'login');
>                $this->Auth->loginRedirect = array('controller' =>
> 'members',
> 'action' => 'home');
>                $this->Auth->loginError = "Incorrect Password!";
>                $this->Auth->authError = "Sorry, you cannot access this
> page.";
>
> }
>
> On Feb 10, 2:49 pm, Miles J <[email protected]> wrote:
> > Can we see your login action() and all the config for auth.
> >
> > On Feb 10, 1:29 pm, Dcahrakos <[email protected]> wrote:
> >
> > > Hi,
> >
> > > I am using the Auth component for registration and login, registration
> > > is working perfectly, but login doesnt seem to be doing anything at
> > > all,
> >
> > > I have Auth loaded in the AppController since I will be using it site
> > > wide, however when I try to log in I just return to the login page
> > > because the page it is supposed to redirect me to requires you to be
> > > logged in.
> >
> > > The only message I get from auth is the message I set "Sorry you
> > > cannot access this page"
> >
> > > my login.ctp is just a simple login form with a username and password
> > > field,  and my Users controller has an empty login function at the
> > > moment.
> >
> > > from what i've read everything should work, however it is not...
> >
> > > am I missing something here? do I need to add code to the login
> > > function of the controller? or add anything to the user model?
> >
> > > Thanks.
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to