projects
/
catagits/Catalyst-Plugin-Authentication.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
(parent:
e5032c4
)
User::Hash prefers id/store based serialization if it's possible
Yuval Kogman [Sun, 4 Dec 2005 12:01:28 +0000 (12:01 +0000)]
lib/Catalyst/Plugin/Authentication/Store/Minimal/Backend.pm
patch
|
blob
|
blame
|
history
lib/Catalyst/Plugin/Authentication/User/Hash.pm
patch
|
blob
|
blame
|
history
diff --git
a/lib/Catalyst/Plugin/Authentication/Store/Minimal/Backend.pm
b/lib/Catalyst/Plugin/Authentication/Store/Minimal/Backend.pm
index
540b4d7
..
d08e330
100644
(file)
--- a/
lib/Catalyst/Plugin/Authentication/Store/Minimal/Backend.pm
+++ b/
lib/Catalyst/Plugin/Authentication/Store/Minimal/Backend.pm
@@
-36,6
+36,8
@@
sub get_user {
return $user;
}
elsif ( ref $user eq "HASH" ) {
+ $user->{id} ||= $id;
+ $user->{store} ||= $self;
return bless $user, "Catalyst::Plugin::Authentication::User::Hash";
}
else {
diff --git
a/lib/Catalyst/Plugin/Authentication/User/Hash.pm
b/lib/Catalyst/Plugin/Authentication/User/Hash.pm
index
962e91a
..
fb18c0b
100644
(file)
--- a/
lib/Catalyst/Plugin/Authentication/User/Hash.pm
+++ b/
lib/Catalyst/Plugin/Authentication/User/Hash.pm
@@
-85,7
+85,7
@@
sub supports {
sub for_session {
my $self = shift;
- return $self; # let's hope we're serialization happy
+ return $self->store && $self->id || $self; # if we have a store and an ID we serialize by ref, otherwise we serialize the whole user
}
sub from_session {