- Timestamp:
- 12/28/12 15:05:24 (11 years ago)
- Location:
- trunk/LATMOS-Accounts-Web/lib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LATMOS-Accounts-Web/lib/Catalyst/Authentication/Credential/La.pm
r895 r1207 99 99 sub _login_auth { 100 100 my ($self, $c, $realm, $authinfo) = @_; 101 my $authheader = $c->req->headers->header('Authorization') 102 or do { 103 $c->log->debug('No Authorization header found'); 104 return; 105 }; 106 # TODO check auth type 107 my ($type, $base64) = $authheader =~ /(\w+) (\S+)/; 108 ($authinfo->{username}, $authinfo->{password}) 109 = decode_base64($base64) =~ /^([^:]+):(.*)/; 101 if (!$authinfo) { 102 my $authheader = $c->req->headers->header('Authorization') 103 or do { 104 $c->log->debug('No Authorization header found'); 105 return; 106 }; 107 # TODO check auth type 108 my ($type, $base64) = $authheader =~ /(\w+) (\S+)/; 109 ($authinfo->{username}, $authinfo->{password}) 110 = decode_base64($base64) =~ /^([^:]+):(.*)/; 111 } 110 112 111 113 if($c->model('Accounts')->db->connect( -
trunk/LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Controller/Root.pm
r1148 r1207 25 25 sub auth_required : Private { 26 26 my ( $self, $c ) = @_; 27 $c->res->status(401); 28 $c->res->content_type('text/plain'); 29 $c->res->body('Authorization required.'); 30 $c->res->headers->push_header( 31 'WWW-Authenticate' => 'Basic realm="Link::Accounts"' 32 ); 27 $c->forward('login'); 33 28 } 34 29 … … 47 42 } else { 48 43 # No need to login for About section 49 if (!$c->authenticate({}, 'la')) { 44 if (!$c->authenticate({ username => $c->req->param('login'), password => 45 $c->req->param('password') }, 'la')) { 50 46 $c->forward('auth_required'); 51 47 return;
Note: See TracChangeset
for help on using the changeset viewer.