should i be handling logging in using the rest api, or should i be able to also use the local api? in the docs i see:
const result = await payload.login({
collection: 'users', // required
data: {
// required
email: '[email protected]',
password: 'rip',
},
req: req, // pass an Express `req` which will be provided to all hooks
res: res, // used to automatically set an HTTP-only auth cookie
depth: 2,
locale: 'en',
fallbackLocale: false,
overrideAccess: false,
showHiddenFields: true,
})```
but i'm using next.js and i'm not sure what would be analogous to providing `res` in this example.