X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2Fstemmaweb.pm;h=cc91f529e4c545854bc384da059b00312b4b9514;hb=b1d9ab02c0b3c923596ebae9d3e2e4c45397c8f7;hp=336605570ea185076e1c70c6f468c545d8d387ec;hpb=51cece70cc0a96df15796b556bb7f4a15d85802e;p=scpubgit%2Fstemmaweb.git diff --git a/lib/stemmaweb.pm b/lib/stemmaweb.pm index 3366055..cc91f52 100644 --- a/lib/stemmaweb.pm +++ b/lib/stemmaweb.pm @@ -23,12 +23,12 @@ use Search::GIN::Extract::Multiplex; use Catalyst qw/ ConfigLoader Static::Simple - Unicode::Encoding Authentication Session Session::Store::File Session::State::Cookie StatusMessage + StackTrace /; extends 'Catalyst'; @@ -48,6 +48,8 @@ __PACKAGE__->config( name => 'stemmaweb', # Disable deprecated behavior needed by old applications disable_component_resolution_regex_fallback => 1, + # Set Unicode as the default + encoding => 'UTF-8', default_view => 'TT', 'View::JSON' => { expose_stash => 'result', @@ -59,6 +61,7 @@ __PACKAGE__->config( }, ## kiokudb auth store testing 'Plugin::Authentication' => { + form_handler => '+stemmaweb::Authentication::FormHandler', default => { credential => { class => 'Password', @@ -67,7 +70,7 @@ __PACKAGE__->config( }, store => { class => 'Model::KiokuDB', - model_name => 'User', + model_name => 'Directory', }, }, openid => { @@ -79,31 +82,54 @@ __PACKAGE__->config( uri => 'http://openid.net/srv/ax/1.0', mode => 'fetch_request', required => 'email', - type => { - email => 'http://axschema.org/contact/email' - } + 'type.email' => 'http://axschema.org/contact/email', + # type => { + # email => 'http://axschema.org/contact/email' + # } } ], }, store => { class => 'Model::KiokuDB', - model_name => 'User', + model_name => 'Directory', }, auto_create_user => 1, }, + google => { + credential => { + class => '+stemmaweb::Authentication::Credential::Google', + }, + store => { + class => 'Model::KiokuDB', + model_name => 'Directory', + } + }, }, ## 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', + action_after_login => '/users/success', + action_after_register => '/users/success', + enable_sending_register_email => 0, + register_email_from => '"Stemmaweb" ', + register_email_subject => 'Registration to stemmaweb', + register_email_template_plain => 'register-plain.tt', + realm => 'default', login_fields => { openid => [qw/openid_identifier/], - default => [qw/username password/], + default => [qw/username password remember/], + google => [qw/email id_token/], }, }, + 'View::Email::Template' => { + stash_key => 'email_template', + }, + + recaptcha => { + pub_key => '6LfR19MSAAAAACy2meHvLfZGRn3PM2rRYIAfh665', + priv_key => '6LfR19MSAAAAAMlQb8BdyecWNRE1bAL2YSgz2sah', + }, ); # Start the application