fix for openid authentication
Eden Cardim [Wed, 4 Jul 2012 19:24:57 +0000 (16:24 -0300)]
lib/stemmaweb.pm
lib/stemmaweb/Controller/Users.pm
root/src/auth/login.tt

index b4984e6..7427973 100644 (file)
@@ -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/],
         },
     },
 );
index 19a72b5..71ee603 100644 (file)
@@ -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
 
index d848853..7779789 100644 (file)
 
        </form>
 
+[% UNLESS c.req.param('realm') == 'openid' %]
        <form method="post" action="[% c.uri_for_action('/users/login').hostless | html %]" autocomplete="off">
 
     <input type="hidden" name="realm" value="default"/>
 
        [% form.field('username').render %]
        [% form.field('password').render %]
+       [% form.field('remember').render %]
 
        [% form.field('submit').render %]
 
-       </form>
\ No newline at end of file
+       </form>
+[% END %]
\ No newline at end of file