-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Open
Labels
area: docsImprovements or additions to documentationImprovements or additions to documentation
Description
Documentation Issue
Payload has functionality built in for users to reset their password through an email. The docs are unclear as to what the URL you can use is if you customize the email HTML but still want to use the default password reset page.
For example:
auth: {
forgotPassword: {
generateEmailSubject: () => `Wachtwoord vergeten - ${env.APP_NAME}`,
generateEmailHTML: async (args) => {
if (args?.user.name && args?.user.email) {
const html = await render(
ForgotPasswordEmail({
firstName: args.user.name,
// The docs don't make it clear that the `/admin/reset/{token}` page exists and that we can direct the reset link to it.
resetPasswordLink: `${getServerSideURL()}/admin/reset/${args.token}`,
}),
)
return html
}
return ''
},
},
},Additional Details
Relevant documentation page: https://payloadcms.com/docs/authentication/email#forgot-password
Metadata
Metadata
Assignees
Labels
area: docsImprovements or additions to documentationImprovements or additions to documentation