Skip to content

Unclear what the default password reset URL is. #14575

@Joehoel

Description

@Joehoel

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 documentation

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions