Reset password email ๐จ
The default email
- From: [email protected], but the user will see your app name
- Subject:
Reset password instructions
Send a custom email ๐ถ๏ธ
You can take full control of sending a password reset email by providing the createAndSendCustomEmail
function during initialisation (on the backend):
// backend code
supertokens.init({
supertokens: {...},
appInfo: {...},
recipeList: [
EmailPassword.init({
resetPasswordUsingTokenFeature: {
createAndSendCustomEmail: async (user, passwordResetURLWithToken) => {
let {id, email} = user;
// TODO:
}
}
}),
Session.init()
]
});
- You can get the user's email via the
user
input param. - Your email must direct the user to open the
passwordResetURLWithToken
link. This link is a full URL, with the password reset token. It points to the password reset page on your website (/auth/reset-password
by default). - Any errors thrown from this function will be ignored.
- The function will be called each time the user clicks on the button to send a password reset email.
- You must manage sending the email yourself if you provide this function