Like what we’re doing? Star us on GitHub!

How to set expiration limit for forgotpassword token ?

4 weeks ago

How to change expiration limit for forgot password token from 1 hour ?

  • thisisnotchris
    4 weeks ago

    @Veera26 According to the source, the options for forgotPassword are as follows:

    export type Arguments = {
      collection: Collection
      data: {
        email: string
        [key: string]: unknown
      disableEmail?: boolean
      expiration?: number
      req: PayloadRequest


    Lucky for you, the default is one hour

      user.resetPasswordExpiration = expiration || + 3600000; // 1 hour
  • Veera26
    3 weeks ago

    OKay thanks

    I will look into it

Open the post
Continue the discussion in Discord
Can't find what you're looking for?
Get help straight from the Payload team with an Enterprise License.Learn More