fixing bug in compatibility mode - when no 'authentication' config defined
Matt S Trout [Tue, 17 Jul 2007 16:58:45 +0000 (16:58 +0000)]
r35881@cain (orig r5998):  jayk | 2007-01-20 03:47:13 +0000

Changes
lib/Catalyst/Plugin/Authentication.pm

diff --git a/Changes b/Changes
index 63e32cf..eb9b641 100644 (file)
--- 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
index b2e7cbd..d8e25c4 100644 (file)
@@ -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,