X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2Fstemmaweb.pm;h=f9e109289b8d70b99b37a97d43f68fbfa9f986c2;hb=7e48fe7e26e40815f826968cf9d6b48f0aa21a1d;hp=ba6ea4af0a3cb439f73a1aaa3b0fd7f581618ea8;hpb=eb38afbcd0ef1e20b95b9954a0b8d0f107d0c342;p=scpubgit%2Fstemmaweb.git diff --git a/lib/stemmaweb.pm b/lib/stemmaweb.pm index ba6ea4a..f9e1092 100644 --- a/lib/stemmaweb.pm +++ b/lib/stemmaweb.pm @@ -23,17 +23,20 @@ use Search::GIN::Extract::Multiplex; use Catalyst qw/ ConfigLoader Static::Simple - Unicode::Encoding Authentication Session Session::Store::File Session::State::Cookie StatusMessage StackTrace + Cache /; extends 'Catalyst'; +use Cache::FileCache; +use stemmaweb::Authentication::FormHandler; + our $VERSION = '0.01'; # Configure the application. @@ -49,6 +52,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', @@ -58,6 +63,15 @@ __PACKAGE__->config( stemmaweb->path_to( 'root', 'src' ), ], }, + + 'Plugin::Cache' => { + backend => { + class => 'Cache::FileCache', + namespace => 'cache', + default_expires_in => 86400, + }, + }, + ## kiokudb auth store testing 'Plugin::Authentication' => { default => { @@ -93,20 +107,33 @@ __PACKAGE__->config( }, auto_create_user => 1, }, + google => { + credential => { + class => '+stemmaweb::Authentication::Credential::Google', + }, + store => { + class => 'Model::KiokuDB', + model_name => 'Directory', + }, + auto_create_user => 1, + }, }, ## Auth with CatalystX::Controller::Auth 'Controller::Users' => { + form_handler => 'stemmaweb::Authentication::FormHandler', model => 'User', login_id_field => 'username', login_db_field => 'username', 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 remember/], + google => [qw/email id_token/], }, }, 'View::Email::Template' => {