Revision history for Catalyst-Plugin-Authentication-Store-DBIx-Class
+ * If use_userdata_from_session isn't set, then don't store more
+ fields than we need in the session -- only the fields we need to
+ load the object from the DB again.
+
0.1500 2010-11-16
* Allow specifying a fully loaded DBIC result in addition to resultsets
of which only the first row is considered.
#return $frozenuser;
my %userdata = $self->_user->get_columns();
- return \%userdata;
+
+ # If use_userdata_from_session is set, then store all of the columns of the user obj in the session
+ if (exists($self->config->{'use_userdata_from_session'}) && $self->config->{'use_userdata_from_session'} != 0) {
+ return \%userdata;
+ } else { # Otherwise, we just need the PKs for load() to use.
+ my %pk_fields = map { ($_ => $userdata{$_}) } @{ $self->config->{id_field} };
+ return \%pk_fields;
+ }
}
sub from_session {