Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions lib/Dancer2/Plugin/Auth/Extensible/Provider/Database.pm
Original file line number Diff line number Diff line change
Expand Up @@ -355,9 +355,11 @@ sub create_user {
my $username = delete $options{username}
or croak "username needs to be specified for create_user";

my $database = $self->plugin_database($self->db_connection_name);

# password column might not be nullable so set to empty since we fail
# auth attempts for empty passwords anyway
my $ret = $self->database->quick_insert( $self->users_table,
my $ret = $database->quick_insert( $self->users_table,
{ $self->users_username_column => $username, password => '', %options }
);
return $ret ? $self->get_user_details($username) : undef;
Expand All @@ -375,7 +377,7 @@ sub get_user_details {
unless defined $username;

# Get our database handle and find out the table and column names:
my $database = $self->database;
my $database = $self->plugin_database($self->db_connection_name);

# Look up the user,
my $user = $database->quick_select(
Expand All @@ -396,7 +398,7 @@ sub get_user_details {
sub get_user_roles {
my ($self, $username) = @_;

my $database = $self->database;
my $database = $self->plugin_database($self->db_connection_name);

# Get details of the user first; both to check they exist, and so we have
# their ID to use.
Expand Down