Tuesday, March 01, 2011

Plack::Middleware::Auth::Form on CPAN

I've got a bit impatient in waiting for feedback and this week I uploaded Plack::Middleware::Auth::Form to CPAN. This does not mean it is entirely finished - but at least it should be easier to install.

Plack::Middleware::Auth::Form has similar functionality as CatalystX::SimpleLogin, but since it is at the Plack level it can be reused by any Plack based framework.

4 comments:

Anonymous said...

zby, thanks for the module. I am excited to put it to use however it's not clear to me how to do so.

I added the enable lines to my builder block but when I make requests to my app I'm not prompted to login. Should I be or is there something else I need to do?

I do have a /login and /logout page as a result of your middleware.

zby said...

It is left to the user to determine which pages should require login. At those pages just redirect to /login (and set the redir_to session parameter) if user_id is not set in session ($env->{'psgix.session'}{user_id}). Thanks for the question - I'll add this to the docs :)

Cosimo said...

Hi zby,

Your module is definitely interesting. However, I thought plack middleware were not supposed handle pages or whole requests, but just act as "filters" to the HTTP request.

What do you think about this?

zby said...

@cosimo - yeah I've been thinking about that and actually the first version was two Apps not a Middleware, but it is much simpler now. There is one predecessor in the Plack distribution itself: Plack::Middleware::Static