X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FAuthentication%2FCredential%2FOpenID.pm;fp=lib%2FCatalyst%2FAuthentication%2FCredential%2FOpenID.pm;h=fa60a9e5c068a1259c0a6a9e030e3a031ff31a31;hb=8b738b15e32a7da02a0b8962f450f02ed239dcbf;hp=80c7ec7d0601b6d15578cdb00179d9ab70bfbe18;hpb=cfead6044805773c94be622d0300315db85428f5;p=catagits%2FCatalyst-Authentication-Credential-OpenID.git diff --git a/lib/Catalyst/Authentication/Credential/OpenID.pm b/lib/Catalyst/Authentication/Credential/OpenID.pm index 80c7ec7..fa60a9e 100644 --- a/lib/Catalyst/Authentication/Credential/OpenID.pm +++ b/lib/Catalyst/Authentication/Credential/OpenID.pm @@ -13,9 +13,10 @@ __PACKAGE__->mk_accessors(qw/ errors_are_fatal extensions trust_root + flatten_extensions_into_user /); -our $VERSION = "0.16_01"; +our $VERSION = "0.16_02"; use Net::OpenID::Consumer; use Catalyst::Exception (); @@ -130,10 +131,14 @@ sub authenticate { my $user = +{ map { $_ => scalar $identity->$_ } qw( url display rss atom foaf declared_rss declared_atom declared_foaf foafmaker ) }; # Dude, I did not design the array as hash spec. Don't curse me [apv]. - for my $key ( keys %extensions ) { - $user->{extensions}->{$key} = $identity->signed_extension_fields($key); + my $vals = $identity->signed_extension_fields($key); + $user->{extensions}->{$key} = $vals; + if ( $self->flatten_extensions_into_user ) + { + $user->{$_} = $vals->{$_} for keys %{$vals}; + } } my $user_obj = $realm->find_user($user, $c);