When you do a big project that have many common functions that you need to reuse to others project, manage the each function individually are very confused an take disorder but the libraries are here…
Add Password Reset to your Node.js Authentication API using Sendgrid.
The following packages will be need:
Update the .env
file with your sendgrid API Key
and FROM email (can be anything) for the mail options.
Update your User schema by adding the following field, resetPasswordToken
and resetPasswordExpires
and generatePasswordReset
method.
In the controllers folder, create a new js file password.js
.
I remember like it was yesterday. I stand barefoot in the grass, picking the browned pigeon pea pods off the vine. My grandmother stands next to me, holding battered tin roasting pan catching the…