X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FAuthentication%2FStore%2FDBIx%2FClass%2FUser.pm;fp=lib%2FCatalyst%2FAuthentication%2FStore%2FDBIx%2FClass%2FUser.pm;h=0bc8b6fad9a211430cc63c52b908058f1f4a295f;hb=48ca4fcff15f7fd29ec3486640c023c92e9696d0;hp=7c6eb7c4ed9c66737c480500ad0368f404fb0344;hpb=a1c47a34a109b5e7717dabc9a84ad40f7465b0d2;p=catagits%2FCatalyst-Authentication-Store-DBIx-Class.git diff --git a/lib/Catalyst/Authentication/Store/DBIx/Class/User.pm b/lib/Catalyst/Authentication/Store/DBIx/Class/User.pm index 7c6eb7c..0bc8b6f 100644 --- a/lib/Catalyst/Authentication/Store/DBIx/Class/User.pm +++ b/lib/Catalyst/Authentication/Store/DBIx/Class/User.pm @@ -189,7 +189,17 @@ sub from_session { # ## if use_userdata_from_session is defined in the config, we fill in the user data from the session. if (exists($self->config->{'use_userdata_from_session'}) && $self->config->{'use_userdata_from_session'} != 0) { - my $obj = $self->resultset->new_result({ %$frozenuser }); + + # We need to use inflate_result here since we -are- inflating a + # result object from cached data, not creating a fresh one. + # Components such as EncodedColumn wrap new() to ensure that a + # provided password is hashed on the way in, and re-running the + # hash function on data being restored is expensive and incorrect. + + my $class = $self->resultset->result_class; + my $source = $self->resultset->result_source; + my $obj = $class->inflate_result($source, { %$frozenuser }); + $obj->in_storage(1); $self->_user($obj); return $self;