[dancer-users] Fwd: DPAE and reset passwords (Dancer2::Plugin::Auth::Extensible)

Nathan Bailey web at polynate.net
Tue Apr 4 08:18:27 BST 2017


On 3 April 2017 at 19:38, Andrew Beverley <andy at andybev.com> wrote:

> On Mon, 3 Apr 2017 19:15:31 +1000 Nathan Bailey wrote:
> > but then clicking the 'Reset password' button doesn't seem to do
> > anything.
>
> As in does a POST request and forwards back to the same page, or
> nothing at all?
>

Back to the same page.


> > The "$app->log(...)" statements don't seem to be appearing anywhere,
> > is there a 'debug' mode I need to turn on or a config setting to
> > direct the logging to a file/Log::Report?
>
> Yes, you can configure that per-dispatcher (with the mode changed to
> DEBUG) but probably easier just to do:
>
> use Dancer2::Plugin::LogReport mode => 'DEBUG';
>

That's in my Main and Extensible.pm but still doesn't seem to give me joy
(other logging is working fine, but nothing from Extensible.pm)
I've put my own 'warn' statements in each subroutine to see the flow (see
below).

DPAEPD lacked a 'get_user_by_code' function; I've added the following and
now the reset password process is happy.

sub get_user_by_code {
    my ($self, $code) = @_;
    croak "code must be defined"
      unless defined $code;

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

    # Get just the username of the user with the matching pw_reset_code
    my $user = $database->quick_lookup(
        $self->users_table, { 'pw_reset_code' => $code }, 'username'
    );

    if (!$user) {
        $self->plugin->app->log("debug", "No such code $code");
        return;
    } else {
        return $user;
    }
}

However, when I try to log in with my reset password, I'm stuck in a loop
at https://metacpan.org/source/HORNBURG/Dancer2-
Plugin-Auth-Extensible-0.703/lib/Dancer2/Plugin/Auth/Extensible.pm#L266; my
home page doesn't seem to want to load.

I have a 'get' route for '/' but perhaps something is missing somewhere
logged_in_user at /Library/Perl/5.18/Dancer2/Plugin/Auth/Extensible.pm line
593.
get_user_details at /Library/Perl/5.18/Dancer2/Plugin/Auth/Extensible.pm
line 571.
plugin-get_user_details at /Library/Perl/5.18/Dancer2/
Plugin/Auth/Extensible/Provider/Database.pm line 375.
Use of uninitialized value in concatenation (.) or string at
/Library/Perl/5.18/Dancer2/Plugin/Auth/Extensible.pm line 265.
Get here, return_url='', home page='/' at
/Library/Perl/5.18/Dancer2/Plugin/Auth/Extensible.pm
line 265.

thanks,
Nathan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.preshweb.co.uk/pipermail/dancer-users/attachments/20170404/b2795d28/attachment.html>


More information about the dancer-users mailing list