Change to using the merged Directory as the User store
[scpubgit/stemmaweb.git] / lib / stemmaweb.pm
index b2f68e8..b7f1c85 100644 (file)
@@ -24,11 +24,11 @@ use Catalyst qw/
     ConfigLoader
     Static::Simple
     Unicode::Encoding
-    +CatalystX::SimpleLogin
     Authentication
     Session
     Session::Store::File
     Session::State::Cookie
+    StatusMessage
 /;
 
 extends 'Catalyst';
@@ -67,9 +67,42 @@ __PACKAGE__->config(
             },
             store => {
                 class => 'Model::KiokuDB',
+                model_name => 'Directory',
+            },
+        },
+        openid => {
+            credential => {
+                class => 'OpenID',
+                extensions => ['http://openid.net/srv/ax/1.0' => 
+                    {
+                        ns          => 'ax',
+                        uri         => 'http://openid.net/srv/ax/1.0',
+                        mode        => 'fetch_request',
+                        required    => 'email',
+                        type        => {
+                            email => 'http://axschema.org/contact/email'
+                        }
+                    }
+                    ],
+            },
+            store => {
+                class => 'Model::KiokuDB',
                 model_name => 'User',
             },
-        }
+            auto_create_user => 1,
+        },
+    },
+    ## Auth with CatalystX::Controller::Auth
+    'Controller::Users' => {
+        model => 'User',
+        login_id_field => 'username',
+        login_db_field => 'username',
+        action_after_login => '/index',
+        send_register_email => 0,
+        realm => 'openid',
+        login_fields => { openid => [qw/openid_identifier/],
+                          default => [qw/username password/],
+        },
     },
 );