I'm working on a "pass through login" type Role for Catalyst (I think that's what I should call it).
The idea looks like this:
package TestApp::Controller::Root;
use Moose;
use namespace::autoclean;
BEGIN { extends 'Catalyst::Controller'; }
with 'CatalystX::RedirectAfterLogin';
sub login : Local {
my ($self, $c) = @_;
if ( $c->req->param('username') eq 'blah' ) {
$c->next_page('success');
} else {
$c->res->body('Failed!');
$c->detach;
}
}
sub success : Path {
my ($self, $c) = @_;
$c->res->body("Success!");
}
This isn't quite working yet. I'm getting some errors with Moose that I can't figure out. Feel free to poke: CatalystX::RedirectAfterLogin







Leave a comment