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?
Then it's a probably a bug, I got stuck at the same thing here and used the REST API as a workaround:
Hey @linobino1, I opened an issue with a bug report here
https://github.com/payloadcms/payload/issues/2170In case you want to follow that
Thanks!
Star
Discord
online
Get help straight from the Payload team with an Enterprise License.