docs: remove outdated res parameter in login and resetPassword operations (#11268)

Fixes https://github.com/payloadcms/payload/issues/9829

As described in the issue, the `res` parameter does no more exist for
these operations. Additionally, marks `req` as an optional property.
This commit is contained in:
Sasha
2025-02-19 03:59:05 +02:00
committed by GitHub
parent 7922d66181
commit 38c1c113ca

View File

@@ -345,8 +345,7 @@ const result = await payload.login({
email: 'dev@payloadcms.com', email: 'dev@payloadcms.com',
password: 'rip', password: 'rip',
}, },
req: req, // pass a Request object to be provided to all hooks req: req, // optional, pass a Request object to be provided to all hooks
res: res, // used to automatically set an HTTP-only auth cookie
depth: 2, depth: 2,
locale: 'en', locale: 'en',
fallbackLocale: false, fallbackLocale: false,
@@ -384,8 +383,7 @@ const result = await payload.resetPassword({
password: req.body.password, // the new password to set password: req.body.password, // the new password to set
token: 'afh3o2jf2p3f...', // the token generated from the forgotPassword operation token: 'afh3o2jf2p3f...', // the token generated from the forgotPassword operation
}, },
req: req, // pass a Request object to be provided to all hooks req: req, // optional, pass a Request object to be provided to all hooks
res: res, // used to automatically set an HTTP-only auth cookie
}) })
``` ```
@@ -399,7 +397,7 @@ const result = await payload.unlock({
// required // required
email: 'dev@payloadcms.com', email: 'dev@payloadcms.com',
}, },
req: req, // pass a Request object to be provided to all hooks req: req, // optional, pass a Request object to be provided to all hooks
overrideAccess: true, overrideAccess: true,
}) })
``` ```