Hey WebWeave,
I dont know but loginRedirect should not cause any issues for routing.. Its
there only to handle the cases if there is nothing in the session variable
Auth.Redirect. I just saw the code which stores Session.redirect
Around line number 289 in components auth.php
$url = Router::normalize($url);
this returns the full url to the controller/action pair rather than
considering the url formed using the routes.
So if i have some thing like follows in my routes.php:
Router::connect('/:uid/*', array('controller' => 'entities', 'action' =>
'view'));
but the above code stores the value /entities/view in the Session
Auth.redirect and completely skips the uid part of the entity.
any help would be appreciated
Thanks.
On Tue, Jan 6, 2009 at 12:16 AM, Webweave <[email protected]> wrote:
>
> Don't set the loginRedirect in your beforeFilter, and then just use
> $this->Auth->redirect() in your login function as follows:
>
>
> /**
> * Login function - this is where we do the login ...
> */
> function login() {
> if ($this->Auth->user())
> {
> $this->Session->SetFlash(__('Successfully logged in as '.
> $auth_user['User']['full_name'],true));
> $this->redirect($this->Auth->redirect());
> }
> }
>
> On Jan 5, 3:22 am, "Novice Programmer" <[email protected]>
> wrote:
> > Hello All,
> >
> > I am trying to set up auth redirect. i.e the user will be redirected to
> > login screen if he accesses a page which can't be accessed without the
> > username/password. After the user authenticates, I try to redirect the
> user
> > back to the page which he was accessing using
> > $this->redirect($this->Auth->referer());
> >
> > Though the user is redirected to the proper page but my custom Routes
> break
> > when such a redirection happens. Here is my auth setup.
> >
> > $this->Auth->actionPath = null;
> > $this->Auth->loginAction = array('controller' => 'invites',
> > 'action' => 'index');
> > $this->Auth->loginRedirect = array('controller' => 'entities',
> > 'action' => 'index');
> > $this->Auth->logoutRedirect = null;
> >
> > Please help on how to go about fixing this.
> > --
> > Thanks & Regards,
> > Novice.
> >
>
--
Thanks & Regards,
Novice.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---