X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/b38b9327a8f11b642e5f51f7ee537043e25ccff9..faf94b578729387f85af2b2b248959debe2fa4b8:/IkiWiki/Plugin/openid.pm?ds=sidebyside diff --git a/IkiWiki/Plugin/openid.pm b/IkiWiki/Plugin/openid.pm index f19a559a9..fae9fb77f 100644 --- a/IkiWiki/Plugin/openid.pm +++ b/IkiWiki/Plugin/openid.pm @@ -187,16 +187,16 @@ sub auth ($$) { $vident->signed_extension_fields('http://openid.net/srv/ax/1.0'), ); } - my $username; + my $nickname; foreach my $ext (@extensions) { foreach my $field (qw{value.email email}) { if (exists $ext->{$field} && defined $ext->{$field} && length $ext->{$field}) { $session->param(email => $ext->{$field}); - if (! defined $username && + if (! defined $nickname && $ext->{$field}=~/(.+)@.+/) { - $username = $1; + $nickname = $1; } last; } @@ -205,14 +205,14 @@ sub auth ($$) { if (exists $ext->{$field} && defined $ext->{$field} && length $ext->{$field}) { - $username=$ext->{$field}; + $nickname=$ext->{$field}; last; } } } - if (defined $username) { - $username=~s/\s+/_/g; - $session->param(username => $username); + if (defined $nickname) { + $session->param(nickname => + Encode::decode_utf8($nickname)); } } else {