change default value for persist_in_session to username
Alexander Hartmaier [Tue, 24 Nov 2015 14:48:40 +0000 (15:48 +0100)]
after discussion with ilmari on IRC about which is the better API

README
lib/Catalyst/Authentication/Store/LDAP.pm
lib/Catalyst/Authentication/Store/LDAP/Backend.pm

diff --git a/README b/README
index ca4dbf3..bd4f03e 100644 (file)
--- a/README
+++ b/README
@@ -275,9 +275,9 @@ CONFIGURATION OPTIONS
     instead be performed when bound as the user you authenticated as.
 
   persist_in_session
-    Can take one of the following values, defaults to undefined:
+    Can take one of the following values, defaults to *username*:
 
-   undefined
+   username
     Only store the username in the session and lookup the user and its roles
     on every request. That was how the module worked until version 1.015 and
     is also the default for backwards compatibility.
index 3c74e47..3f23e5e 100644 (file)
@@ -316,9 +316,9 @@ performed when bound as the user you authenticated as.
 
 =head2 persist_in_session
 
-Can take one of the following values, defaults to undefined:
+Can take one of the following values, defaults to I<username>:
 
-=head3 undefined
+=head3 username
 
 Only store the username in the session and lookup the user and its roles
 on every request. That was how the module worked until version 1.015 and is
index e23c77f..90b170e 100644 (file)
@@ -126,6 +126,7 @@ sub new {
     $config_hash{'user_class'}
         ||= 'Catalyst::Authentication::Store::LDAP::User';
     $config_hash{'role_search_as_user'} ||= 0;
+    $config_hash{'persist_in_session'}  ||= 'username';
 
     Catalyst::Utils::ensure_class_loaded( $config_hash{'user_class'} );
     my $self = \%config_hash;