sub add_user {
my ($self, $userinfo) = @_;
- my $username = $userinfo->{username};
+ my $username = $userinfo->{url} || $userinfo->{username};
my $password = $userinfo->{password};
- return unless $username && $self->validate_password($password);
+ return unless ($username =~ /^https?:/
+ || ($username && $self->validate_password($password))) ;
my $user = Text::Tradition::User->new(
id => $username,
- password => crypt_password($password),
+ password => ($password ? crypt_password($password) : ''),
);
my $scope = $self->new_scope;
return $user;
}
+sub create_user {
+ my $self = shift;
+ return $self->add_user(@_);
+}
+
=head3 find_user
Takes a hashref of C<username>, optionally C<openid_identifier>.