Hi folks, I've been breaking my head over this one for the last 3 hours and I can't figure out what the hell is going on. I'm using Catalyst::Authentication to deal with authentication, as follows:

in Root.pm:

sub auto {
  my $self = shift;
  my $c = shift;

  if(!$c->user_exists) {
    warn "user does not exist\n";
    $c->res->redirect('/login');
    return 0;
  }
  return 1;
}

sub index :Path Args(0) {
  my $self = shift;
  my $c = shift;
  $c->res->redirect('/dashboard/');
}

So far so good, but... when loading up without being logged in, this happens:

user does not exist
[info] *** Request 4 (0.037/s) [4201] [Wed Jan 26 17:07:35 2011] ***
[debug] "GET" request for "/" from "127.0.0.1"
[debug] Path is "/"
[debug] Found sessionid "130f7df91fcd9ca31c59eaa9c24f52de63d0c185" in cookie
[debug] Restored session "130f7df91fcd9ca31c59eaa9c24f52de63d0c185"
[debug] Rendering template "index.tt2"
[debug] Redirecting to "/dashboard/"

Strangely enough, it seems that the c->res->redirect isn't taking for some reason, this used to work before, and suddenly stopped working. I've been trying to figure out what I've changed that would cause this, and I haven't touched any of the authentication bits at all.

If I am in fact logged in, c->res->redirect works exactly as advertised and will happily do the trick, except in this case where I have not logged in.

Any ideas? I'm about ready to shoot this project in the head :(

_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/

Reply via email to