On Wed, Sep 8, 2010 at 4:31 AM, Chuck <[email protected]> wrote:
>
> I'm trying to design the login process in a particular way, but am
> having trouble using the Auth component and would really appreciate
> some assistance.
>
> First of all, this is my app_controller.php file:
>
> <?php
> class AppController extends Controller {
>  var $components = array( 'Auth', 'Session' );
> }
> ?>


What does AppController::beforeFilter() look like? That's where a lot
of Auth's config should be.


> These are the functions in users_controller:
>
>
> function beforeFilter() {
>  $this->Auth->fields = array(
>    'username' => 'email',
>    'password' => 'password' );
>  $this->Auth->allow( '*' );
>  $this->Auth->loginRedirect = array( 'controller' => 'pages',
> 'action' => 'home' );
>  parent::beforeFilter();
> }
> function login() {
> }
> function logout() {
>  $this->redirect( $this->Auth->logout() );
> }

parent::beforeFilter() should be at the top, AFAIK.


>  When I login I see pages/home flash briefly,
> but then it returns to users/login.

That doesn't seem right. I mean, you shouldn't be able to see home at
all. The view shouldn't be rendered if Auth is redirecting you. If
you're seeing it flash, I'd guess there's some javascript or a meta
redirect involved. Strange. Try using Firebug or similar to monitor
the request.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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