BTrey has asked for the wisdom of the Perl Monks concerning the following question:
I'm creating a site with Dancer2 and adding authentication. I've created a simple form page to create user accounts but am getting an error when I try to call the create_user function:
post '/adduser' => sub { create_user username=>param{'Username'}; user_password username => param{'Username'}, password => param{'Pa +ssword'}; };
This results in a 500 error:
Can't locate object method "create_user" via package "Dancer2::Plugin::Auth::Extensible::Provider::Database" at /usr/local/share/perl/5.14.2/Dancer2/Plugin/Auth/Extensible.pm line 696.
This simple test page:get '/admin' => require_role admin => sub { return 'You found the admin page!'; };
opens up the built-in "Login Required" page, so the auth module is installed and functioning.
Looking at the Extensible module, the code that errors out is:
my $user = $provider->create_user(%options);
So it looks to me as if the provider module should implement the function, and that seems to be back up by the error message. But checking the modules,none of them do:
Any help greatly appreciated.Provider# ls Base.pm Config.pm Database.pm Example.pm Unix.pm Provider# grep create_user * Provider# grep sub * Base.pm:sub new { Base.pm:sub realm_settings { shift->{realm_settings} || {} } Base.pm:sub realm_dsl { shift->{dsl} } Base.pm:sub match_password { Base.pm:sub encrypt_password { Base.pm: *$method = sub { Config.pm:sub authenticate_user { Config.pm:sub get_user_details { Config.pm:sub get_user_roles { Database.pm:sub authenticate_user { Database.pm:sub get_user_details { Database.pm:sub get_user_roles { Example.pm:sub users { Example.pm:sub authenticate_user { Example.pm:sub get_user_details { Example.pm:sub get_user_roles { Unix.pm:sub authenticate_user { Unix.pm:sub get_user_details { Unix.pm:sub get_user_roles {
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Dancer2 Extensible Auth create_user
by Anonymous Monk on Jan 31, 2016 at 10:40 UTC | |
by BTrey (Novice) on Jan 31, 2016 at 15:50 UTC | |
by Anonymous Monk on Jan 31, 2016 at 21:50 UTC |