I am writing a test that ensures that the password reset functionality of my application works. The password reset system was created using the php artisan make:auth
command. In order to make the test pass I need to automate a GET request to /password/reset/{$token}
where $token
is the value stored in the password_resets
table. Laravel stores the token like this:
$2y$10$9grKb3c6.Toiv0kjUWbCUeT8Q8D.Fg2gZ/xDLGQUAkmdyHigmRkNW
but when Laravel sends the password reset email to the user, the reset token looks like this in the email:
382aa64567ecd05a774c2e4ebb199d3340a1424300707053354c749c10487594
.
My GET request to /password/reset/$2y$10$9grKb3c6.Toiv0kjUWbCUeT8Q8D.Fg2gZ/xDLGQUAkmdyHigmRkNW
fails due to the forward slash in the reset token. (Right after the 'g2gZ')
I tried using the helper function decrypt()
but had no luck.
How can I convert the password reset token I pull from the password_resets
table to match what Laravel sends to the user?
Not sure if this is relevant but I did upgrade my application from 5.3 to 5.4.