last day (16 days later) » 

7:57 PM
0
A: custom password reset api in laravel 5.7

AdrienThe Hasher used by the Laravel default implementation can be retrieved with $hasher = Password::broker()->getRepository()->getHasher(); You can then hash your token to add them to your database like this : $hasher->make($token); And you can check a token against the value stored in your d...

 
hi. the boiler plate didn't seem to work with restful api but with templating engine. Actually I have to take the emailed token and find the entry in the database with that token to validate it.
or email address sent to me just contains token. How am i supposed to deal with $databasetoken in this case?
 
You still can use Laravel boilerplate and change the default controllers to make it match your RESTful API. They are located at app/Http/Controllers/Auth
@AhmedNawazKhan As the Hasher::make() function does not give the same result each time, you'll need to retrieve the token first. You can associate the token to a unique column to be able to retrieve it, like the email (as Laravel does github.com/laravel/framework/blob/5.7/src/Illuminate/Auth/… )
 
this is not the case because without the api when u click the email sent link u are redirected to page where u have to put your email and new pass. so the actual query that is performed is through email and not through token. I can of api we have to find the entry inside table through token
so may be i need the email in that email sent link too?
 
Token is in a hidden input, token and email are both used to validate the password change
 
so I have to add email to the link that is being sent to the email box. if so how should i do that?
 
7:57 PM
The generated link you include in the email will look like https://server/reset?email=$userEmail&token=$token
 
how can i do this?
 
How is the token currently generated ? How is it currently stored ? How the email is sent ?
 
i just want to add ?email=example.com to link enclosed in the email
 
Do you have the code where the link is generated ? Normally in that code you also receive the email of the user wanting to reset his password so that's it
 

  last day (16 days later) »