Simple Dancer2::Plugin::Auth::Extensible issue
Hi All, I've been struggling with a simple example and trying to get it to work but without any luck. I'm using Dancer2::Plugin::Auth::Extensible to get users/roles and using a simple SQLite database My Config.yml is this (in relation to the database and Auth::Extensible): plugins: Auth::Extensible: realms: users: provider: 'Database' Database: driver: 'SQLite' database: 'users.sqlite' And my DancerWebsite.pm contains these relevant modules: use Dancer2::Session::Memcached; #use Dancer2::Plugin::Auth::Extensible::Provider::Database; # < not sure if I need this, doesn't work either way. use Dancer2::Plugin::Auth::Extensible; use Dancer2::Plugin::Database; I'm getting this error when trying to go to the /login route, which is: Can't locate object method "database" via package "Dancer2::Core::DSL__WITH__Dancer2::Plugin::Auth::Extensible" at /usr/lib/perl5/site_perl/5.22/Dancer2/Plugin/Auth/Extensible/Provider/Database.pm line 186, <$fh> line 12. Line 186: my $database = $self->realm_dsl->database($settings->{db_connection_name}) or die "No database connection"; get '/login' => sub { template login => {}; }; So I'm wondering if I've got something basic wrong here about the modules I'm loading or something, if anyone has had experience using this module? Thanks a lot, David
On Mon, 2015-08-10 at 01:18 +0930, David H wrote:
I've been struggling with a simple example and trying to get it to work but without any luck. I'm using Dancer2::Plugin::Auth::Extensible to get users/roles and using a simple SQLite database
I think you've probably run into this: https://github.com/PerlDancer/Dancer2-Plugin-Auth-Extensible/issues/4
#use Dancer2::Plugin::Auth::Extensible::Provider::Database; # < not sure if I need this, doesn't work either way.
No, you don't need that, but I don't think it will work anyway. Can you use the DBIC provider instead? As a bonus, I think it is currently the only provider that supports full DPAE functionality. I appreciate that adding DBIC is an added layer of complexity if you just want to get something simple up and running, but its use would probably be beneficial in the longer term anyway. https://metacpan.org/pod/Dancer2::Plugin::DBIC Andy
Thanks a lot, I didn't see that. That's exactly my issue. I don't need a DBIC as much as I need an Auth solution (one that supports roles specifically), so I might go back to Dancer2::Plugin::Auth::Tiny for now and implement the roles myself if need be. Thanks a lot, David On Mon, Aug 10, 2015 at 1:41 AM, Andrew Beverley <andy@andybev.com> wrote:
On Mon, 2015-08-10 at 01:18 +0930, David H wrote:
I've been struggling with a simple example and trying to get it to work but without any luck. I'm using Dancer2::Plugin::Auth::Extensible to get users/roles and using a simple SQLite database
I think you've probably run into this:
https://github.com/PerlDancer/Dancer2-Plugin-Auth-Extensible/issues/4
#use Dancer2::Plugin::Auth::Extensible::Provider::Database; # < not sure if I need this, doesn't work either way.
No, you don't need that, but I don't think it will work anyway.
Can you use the DBIC provider instead? As a bonus, I think it is currently the only provider that supports full DPAE functionality.
I appreciate that adding DBIC is an added layer of complexity if you just want to get something simple up and running, but its use would probably be beneficial in the longer term anyway.
https://metacpan.org/pod/Dancer2::Plugin::DBIC
Andy
_______________________________________________ dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
participants (2)
-
Andrew Beverley -
David H