I am using the custom password reset option in Laravel 7. When the user clicks the reset password button (in the inbox of her/his email), the user is redirected to the password reset link. Here is my link
http://localhost/LaraTest/public/reset/5199667639cfc4f5ea624f4c18dbf7e8-vJcnLSH92vAj1IlnV3j7phT8zBtcbX0gSDbjXX37oFsuEM560oAiehZ4oVd0?email=basish%40gmail.com
Here is the code which generates the link
$token1= md5($fp_email);
$token2 = Str::random(60);
$fp_token = $token1."-".$token2;
//some more codes here
$link = 'localhost/LaraTest/public/reset/' . $fp_token . '?email=' . urlencode($fp_email);
//$link is sent to user as email
Route (after some research)
Route::get('reset/{tokenname}{email}','LoginController@resetpassword');
Controller
public function resetpassword(Request $request){
return view('resetpassword');
}
- How would I define my route? I am a bit confused as my link contains both the password reset token and the email id.
- How will I retrieve the password reset token and the email id from the link above,after being redirected to the new password form?
$request->email
within that route and use that to get the user along with their password reset tokens. Have you tried doing that? – apokryfosroutes
andcontroller
– Asish