I try this:
controller auth:
# User login page view
sub login {
my $self = shift;
my $headers = $self->req->headers;
$self->render(from => ($headers->header('referer') or '/'));
};
sub authenticate {
my $from = $self->every_param('from')->[0];
///if login pass ok:
return $self->redirect_to($from);
};
login view
...
%= hidden_field 'from', $from
...
I'm using Mojolicious::Plugin::Authentication and routing via bridge, as
> per the example below.
>
> How can I use this construct to remember the page I was directed from, and
> then go back there once I'm authenticated ? And how could that handle
> several attempts at authentication ? (in case of wrong password)
>
>
> my $auth_bridge = $r->bridge('/members')->to('auth#check');
> $auth_bridge->route('/list')->to('members#list'); # only visible to
> logged in users
>
>
--
You received this message because you are subscribed to the Google Groups
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.