From: Eden Cardim Date: Wed, 4 Jul 2012 19:24:57 +0000 (-0300) Subject: fix for openid authentication X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8591038d46bc45c2664c0f8f05ed7076ea9ae9f8;p=scpubgit%2Fstemmatology.git fix for openid authentication --- diff --git a/stemmaweb/lib/stemmaweb.pm b/stemmaweb/lib/stemmaweb.pm index b4984e6..7427973 100644 --- a/stemmaweb/lib/stemmaweb.pm +++ b/stemmaweb/lib/stemmaweb.pm @@ -101,9 +101,9 @@ __PACKAGE__->config( login_db_field => 'username', action_after_login => '/index', send_register_email => 0, -# realm => 'openid', + realm => 'default', login_fields => { openid => [qw/openid_identifier/], - default => [qw/username password/], + default => [qw/username password remember/], }, }, ); diff --git a/stemmaweb/lib/stemmaweb/Controller/Users.pm b/stemmaweb/lib/stemmaweb/Controller/Users.pm index 19a72b5..71ee603 100644 --- a/stemmaweb/lib/stemmaweb/Controller/Users.pm +++ b/stemmaweb/lib/stemmaweb/Controller/Users.pm @@ -33,6 +33,11 @@ sub index :Path :Args(0) { $c->response->body('Matched stemmaweb::Controller::Users in Users.'); } +before login => sub { + my($self, $c) = @_; + $c->req->param( realm => 'openid') + if $c->req->param('openid-check'); +}; =head1 AUTHOR diff --git a/stemmaweb/root/src/auth/login.tt b/stemmaweb/root/src/auth/login.tt index d848853..7779789 100644 --- a/stemmaweb/root/src/auth/login.tt +++ b/stemmaweb/root/src/auth/login.tt @@ -23,13 +23,16 @@ +[% UNLESS c.req.param('realm') == 'openid' %]
[% form.field('username').render %] [% form.field('password').render %] + [% form.field('remember').render %] [% form.field('submit').render %] -
\ No newline at end of file + +[% END %] \ No newline at end of file