Mercurial > pub > Impl
view Lib/IMPL/Web/QueryHandler/AuthCookie.pm @ 68:739f1288ca84
Auth in progress
author | wizard |
---|---|
date | Tue, 23 Mar 2010 16:55:25 +0300 |
parents | |
children | 8c7b88bdb663 |
line wrap: on
line source
package IMPL::Web::QueryHandler::AuthCookie; use base qw(IMPL::Web::QueryHandler); use Digest::MD5 qw(md5_hex); use IMPL::Class::Property; BEGIN { public property salt => prop_all; } sub Process { my ($this,$action,$nextHandler) = @_; my $method = $action->query->cookie('method') || 'simple'; if ($method eq 'simple') { if ($action->query->cookie('sign') eq md5_hex( $this->salt, $action->query->cookie('sid'), $this->salt ) ) { my $context = $action->application->security->Session($action->query->cookie('sid')); $context->auth-> } } else { die new IMPL::Exception("Unknown auth method",$method); } } 1;