X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FAuthentication%2FStore%2FLDAP%2FUser.pm;fp=lib%2FCatalyst%2FAuthentication%2FStore%2FLDAP%2FUser.pm;h=547e7c973705fe2b46a83e62a9a984bcbad82b2c;hb=e5e1d261e90dcc1f0e6a055185816c2f1b7735cd;hp=96dc6e7b48ddc5a6a62699a246d14382120bbb20;hpb=e0c4eaa2c512a316a689a4a46086e64ef390c9f9;p=catagits%2FCatalyst-Authentication-Store-LDAP.git diff --git a/lib/Catalyst/Authentication/Store/LDAP/User.pm b/lib/Catalyst/Authentication/Store/LDAP/User.pm index 96dc6e7..547e7c9 100644 --- a/lib/Catalyst/Authentication/Store/LDAP/User.pm +++ b/lib/Catalyst/Authentication/Store/LDAP/User.pm @@ -168,6 +168,9 @@ sub roles { Returns the user for persistence in the session depending on the persist_in_session config option. +Stores the persist_in_session setting so it can be used to revive the user +even if the setting has been changed. + =cut sub for_session { @@ -175,7 +178,13 @@ sub for_session { if ( $self->store->persist_in_session eq 'all' ) { # use the roles accessor to ensure the roles are fetched - return { user => $self->user, _roles => [ $self->roles ] }; + return { + # store the persistance setting in the session to know how to + # restore the user + persist_in_session => $self->store->persist_in_session, + user => $self->user, + _roles => [ $self->roles ], + }; } return $self->stringify;