From: Matt S Trout Date: Tue, 17 Jul 2007 16:58:45 +0000 (+0000) Subject: fixing bug in compatibility mode - when no 'authentication' config defined X-Git-Tag: v0.10009_01~72 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=937d5ab9a47790d867100f447a32bcc11d074345;p=catagits%2FCatalyst-Plugin-Authentication.git fixing bug in compatibility mode - when no 'authentication' config defined r35881@cain (orig r5998): jayk | 2007-01-20 03:47:13 +0000 --- diff --git a/Changes b/Changes index 63e32cf..eb9b641 100644 --- a/Changes +++ b/Changes @@ -1,10 +1,10 @@ Revision history for Perl extension Catalyst::Plugin::Authentication 0.10 - - major changes to the internals of the plugin, to better encapsulate - credentials and stores. - - introduction of 'realms' concept, allowing multiple different - pairs of credential and store in a single application. + - major changes to the internals of the plugin, to better encapsulate + credentials and stores. + - introduction of 'realms' concept, allowing multiple different + pairs of credential and store in a single application. 0.09 - be a bit more pedantic about checking values for definedness before diff --git a/lib/Catalyst/Plugin/Authentication.pm b/lib/Catalyst/Plugin/Authentication.pm index b2e7cbd..d8e25c4 100644 --- a/lib/Catalyst/Plugin/Authentication.pm +++ b/lib/Catalyst/Plugin/Authentication.pm @@ -187,7 +187,11 @@ sub _authentication_initialize { if ($c->_auth_realms) { return }; - my $cfg = $c->config->{'authentication'} || {}; + if (!exists($c->config->{'authentication'}) { + $c->config->{'authentication'} = {}; + } + + my $cfg = $c->config->{'authentication'}; %$cfg = ( use_session => 1,