Hi Richard Firstly with the GET request when you click on this
http://myapp.com/reset/JiOk49ld9oekdisJkflSS3ed <http://myapp.com/resetJiOk49ld9oekdisJkflSS3ed> your route handler will be something like this (note ':' instead of '$'): get '/reset/:token' => sub { return template 'pass_reset' => { token => params->{token} }; }; This template views/pass_reset.tt will contain something like <form action="/reset/[% token %]" method="post"> <input type="password" name="password1"><br/> <input type="password" name="password2"><br/> <input type="submit" value="Submit"> </form> and back in the controller on clicking submit, it will be handled by post '/reset/:token' => sub { # do something to check params->{password1} eq params->{password2} ... }; (Please imagine the code above is scribbled on a blackboard - I haven't run it:) Andrew On Wed, Sep 16, 2015 at 10:26 PM, Richard Reina <[email protected]> wrote: > Forgive me for being clueless, but can someone tell me how I can have > route handler for a URL that matches a token. Such that a user can receive > an email that says: > > Go here to reset your password > http://myapp.com/resetJiOk49ld9oekdisJkflSS3ed (where > JiOk49ld9oekdisJkflSS3ed is the token ) and then dancer would bring them to > the template where they can reset their password. > > I can't seem to wrap my mind around how such a thing would work. > > get '/reset/'$token => sub { > > template 'pass_reset'; > > } > > post '/reset/'$token => sub { # let user reset password > > my $input_hash = { > > Pswd => param('password1'), > PswdConfirm => param('password2'), > > }; > > template 'pass_reset'; > > }; > > Any help would be greatly appreciated. > > Thanks > > _______________________________________________ > dancer-users mailing list > [email protected] > http://lists.preshweb.co.uk/mailman/listinfo/dancer-users > > -- Andrew Solomon Mentor@Geekuni http://geekuni.com/ http://www.linkedin.com/in/asolomon
_______________________________________________ dancer-users mailing list [email protected] http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
