<div dir="ltr">Hi Richard<div><br></div><div>Firstly with the GET request when you click on this</div><div><br></div><div><span style="font-size:12.8000001907349px"> </span><a href="http://myapp.com/resetJiOk49ld9oekdisJkflSS3ed" target="_blank" style="font-size:12.8000001907349px">http://myapp.com/reset/JiOk49ld9oekdisJkflSS3ed</a><br></div><div><br></div><div>your route handler will be something like this (note ':' instead of '$'):</div><div><br></div><div>get '/reset/:token' => sub {</div><div><br></div><div> return template 'pass_reset' => {</div><div> token => params->{token}</div><div> };</div><div><br></div><div>};</div><div><br></div><div>This template views/<a href="http://pass_reset.tt">pass_reset.tt</a> will contain something like</div><div><br></div><div><div><form action="/reset/[% token %]" method="post"></div><div> <input type="password" name="password1"><br/></div><div> <input type="password" name="password2"><br/></div><div> <input type="submit" value="Submit"></div><div></form></div><div><br></div></div><div><br></div><div>and back in the controller on clicking submit, it will be handled by</div><div><br></div><div><div>post '/reset/:token' => sub {</div><div><br></div><div> # do something to check params->{password1} eq params->{password2} ...</div><div><br></div><div>};</div></div><div><br></div><div><br></div><div>(Please imagine the code above is scribbled on a blackboard - I haven't run it:)</div><div><br></div><div>Andrew</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Sep 16, 2015 at 10:26 PM, Richard Reina <span dir="ltr"><<a href="mailto:gatorreina@gmail.com" target="_blank">gatorreina@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div>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:<br><br></div>Go here to reset your password <a href="http://myapp.com/resetJiOk49ld9oekdisJkflSS3ed" target="_blank">http://myapp.com/resetJiOk49ld9oekdisJkflSS3ed</a> (where JiOk49ld9oekdisJkflSS3ed is the token ) and then dancer would bring them to the template where they can reset their password.<br><br></div>I can't seem to wrap my mind around how such a thing would work. <br><br>get '/reset/'$token => sub {<br><br></div><div> template 'pass_reset';<br></div><div><br>}<br><br>post '/reset/'$token => sub { # let user reset password<br> <br> my $input_hash = { <br> <br> Pswd => param('password1'), <br> PswdConfirm => param('password2'),<br> <br> }; <br><br></div><div>template 'pass_reset';<br></div><div><br>};<br><br></div><div>Any help would be greatly appreciated.<br><br></div><div>Thanks<br></div></div>
<br>_______________________________________________<br>
dancer-users mailing list<br>
<a href="mailto:dancer-users@dancer.pm">dancer-users@dancer.pm</a><br>
<a href="http://lists.preshweb.co.uk/mailman/listinfo/dancer-users" rel="noreferrer" target="_blank">http://lists.preshweb.co.uk/mailman/listinfo/dancer-users</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">Andrew Solomon<div><br></div><div>Mentor@Geekuni <a href="http://geekuni.com/" target="_blank">http://geekuni.com/</a></div><div><a href="http://www.linkedin.com/in/asolomon" target="_blank">http://www.linkedin.com/in/asolomon</a><br></div></div></div>
</div>