docs: autoLogin codeblock was not nested under 'admin' (#12573)

Additionally changed `process.env.NEXT_PUBLIC_ENABLE_AUTOLOGIN` to `NODE_ENV` since this is a more standard practice.
This commit is contained in:
Jordy
2025-05-28 17:50:56 -05:00
committed by GitHub
parent bfdcb51793
commit 0c0b0fe0f8

View File

@@ -142,14 +142,17 @@ import { buildConfig } from 'payload'
export default buildConfig({
// ...
// highlight-start
autoLogin:
process.env.NEXT_PUBLIC_ENABLE_AUTOLOGIN === 'true'
? {
email: 'test@example.com',
password: 'test',
prefillOnly: true,
}
: false,
admin: {
autoLogin:
process.env.NODE_ENV === 'development'
? {
email: 'test@example.com',
password: 'test',
prefillOnly: true,
}
: false,
}
// highlight-end
})
```