fix _auth_realms check to actually work now that we create the classdata in
Matt S Trout [Tue, 17 Jul 2007 16:58:57 +0000 (16:58 +0000)]
the initialize routine
r36208@cain (orig r6089):  jayk | 2007-02-19 18:35:25 +0000

lib/Catalyst/Plugin/Authentication.pm
lib/Catalyst/Plugin/Authentication/Internals.pod

index 317bf82..00753d3 100644 (file)
@@ -184,19 +184,16 @@ sub setup {
 sub _authentication_initialize {
     my $app = shift;
 
-    if ($app->_auth_realms) { return };
-    
+    ## let's avoid recreating / configuring everything if we have already done it, eh?
+    if ($app->can('_auth_realms')) { return };
 
+    ## make classdata where it is used.  
+    $app->mk_classdata( '_auth_realms' => {});
     
     my $cfg = $app->config->{'authentication'} ||= {};
 
     $cfg->{use_session} = 1;
-
-    ## make classdata where it is used.  
-    $app->mk_classdata( _auth_realms => {});
-    
     
-
     if (exists($cfg->{'realms'})) {
         foreach my $realm (keys %{$cfg->{'realms'}}) {
             $app->setup_auth_realm($realm, $cfg->{'realms'}{$realm});
index c383373..9cbafd5 100644 (file)
@@ -325,9 +325,9 @@ Jay Kuri, C<jayk@cpan.org>
 
 =head1 COPYRIGHT & LICENSE
 
-        Copyright (c) 2005 the aforementioned authors. All rights
-        reserved. This program is free software; you can redistribute
-        it and/or modify it under the same terms as Perl itself.
+Copyright (c) 2005 the aforementioned authors. All rights
+reserved. This program is free software; you can redistribute
+it and/or modify it under the same terms as Perl itself.
 
 =cut