Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

How to trigger "forgot password" flow through local API

default discord avatar
mosattler2 years ago
3

I am trying this


await payload.forgotPassword({
  collection: "users",
  data: {
    email,
  },
});


but this gives me following error:


TypeError: Cannot read properties of undefined (reading 'config')
    at forgotPassword (/Users/user/directory/node_modules/payload/src/auth/operations/forgotPassword.ts:51:9)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)


reseting the password via the

/admin/forgot

works without a problem though. So it cannot be my email setup I guess.



Anyone an idea?

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get dedicated engineering support directly from the Payload team.