This commit is contained in:
parent
a27c335113
commit
3d4499fb80
@ -60,14 +60,14 @@ export default buildConfig({
|
||||
async onInit(payload) {
|
||||
const existingUsers = await payload.find({
|
||||
collection: 'users',
|
||||
limit: 1,
|
||||
limit: 2,
|
||||
})
|
||||
|
||||
if (existingUsers.docs.length === 0) {
|
||||
if (existingUsers.docs.length === 0 || existingUsers.docs.length === 1) {
|
||||
await payload.create({
|
||||
collection: 'users',
|
||||
data: {
|
||||
email: 'dev@payloadcms.com',
|
||||
email: 'admin@nextload.test',
|
||||
password: 'test',
|
||||
roles: ['admin'],
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user