Mercurial > pub > Impl
diff 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 diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Lib/IMPL/Web/QueryHandler/AuthCookie.pm Tue Mar 23 16:55:25 2010 +0300 @@ -0,0 +1,37 @@ +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; \ No newline at end of file