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:

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 {
Any help greatly appreciated.

In reply to Dancer2 Extensible Auth create_user by BTrey

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.