From 0adf0bd51f47c447fcbe86b269c0f1433d642cdd Mon Sep 17 00:00:00 2001 From: John O'Keefe Date: Sat, 5 Sep 2026 22:48:53 -0400 Subject: [PATCH] fix(admin): await user.save() without callback in createAdmin Mongoose 7 removed callback support on Model.prototype.save(), so the seeder threw 'no longer accepts a callback' on every boot (caught and logged, non-fatal, but noisy and the success path never ran). Await the promise and log on success. --- scripts/adminUser.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/scripts/adminUser.js b/scripts/adminUser.js index 03499ee..eb36f37 100644 --- a/scripts/adminUser.js +++ b/scripts/adminUser.js @@ -33,12 +33,8 @@ const createAdmin = async () => { gamesToAccess: [], }) - await user.save((err) => { - console.log('Admin user successfully created') - if (err) { - return console.error('Could not save admin user') - } - }) + await user.save() + console.log('Admin user successfully created') } catch (err) { return console.error( 'Server Error: Could not create admin user' + err.message