CatalystX::RedirectAfterLogin

| No Comments | No TrackBacks

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

No TrackBacks

TrackBack URL: http://www.codedright.net/mt/mt-tb.fcgi/51

Leave a comment

About this Entry

This page contains a single entry by Devin published on July 13, 2009 2:55 AM.

MT Upgraded was the previous entry in this blog.

Better than mine: CatalystX::SimpleLogin is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Recent Photos

OpenID accepted here Learn more about OpenID
Powered by Movable Type 4.261