Fix issue if you have auth store plugins before authentication plugin
Tomas Doran [Mon, 29 Jun 2009 16:55:35 +0000 (16:55 +0000)]
Changes
lib/Catalyst/Plugin/Authentication.pm

diff --git a/Changes b/Changes
index 56eb2ea..6550ecc 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,5 +1,10 @@
 Revision history for Perl extension Catalyst::Plugin::Authentication
 
+      - Make auth_realms method ensure authentication is initialized
+        before calling methods which get created during auth initialization.
+        Fixes back compat cases where auth store is in the plugin list
+        before the authentication plugin. (t0m)
+
 0.10013 Fri Jun 19 16:08:00 BST 2009
       - Add a username_field config item to ::Credential::Remote
         (Nigel Metheringham)
index ca0c425..91ac80b 100644 (file)
@@ -342,14 +342,13 @@ sub setup_auth_realm {
 
 sub auth_realms {
     my $self = shift;
+    $self->_authentication_initialize(); # Ensure _auth_realms created!
     return($self->_auth_realms);
 }
 
 sub get_auth_realm {
     my ($app, $realmname) = @_;
-    
     return $app->auth_realms->{$realmname};
-    
 }