Closed tomparkp closed 3 months ago
Changed those to be a generic that can be passed down, will be available in the next beta release some time this week
This issue has been automatically locked. Please open a new issue if this issue persists with any additional detail.
Link to reproduction
No response
Payload Version
3.0.0-beta.54
Node Version
18
Next.js Version
15
Describe the Bug
I've noticed a discrepancy between the type signatures of
GenerateForgotPasswordEmailHTML
andGenerateVerifyEmailHTML
that seems like it might be unintentional:Based on the docs you would implement a custom Forgot Password email via
user.email
but user is both optional andunknown
vs non-optional andany
in the verify email signature. I'm addressing it by using a type guard and throwing an error if the email isn't present (not necessary for the verify email given the difference in signature).Additionally this is more of a feature request but many of the types within Payload such as these could be improved with generics e.g.
type GenerateForgotPasswordEmailHTML<UserType = unknown>
so consumers can supply the TS definition for the user record. Ideally that could be taken a step further and the types could be automatically inferred from the collection definition itself, but I understand Typescript gymnastics can get complicated and that would be a bigger effort.Reproduction Steps
Adapters and Plugins
No response