diff --git a/core/server/api/canary/authentication.js b/core/server/api/canary/authentication.js index 50a98b25a5..c7d29332a3 100644 --- a/core/server/api/canary/authentication.js +++ b/core/server/api/canary/authentication.js @@ -98,17 +98,15 @@ module.exports = { isSetup: { permissions: false, - query() { - return auth.setup.checkIsSetup() - .then((isSetup) => { - return { - status: isSetup, - // Pre-populate from config if, and only if the values exist in config. - title: config.title || undefined, - name: config.user_name || undefined, - email: config.user_email || undefined - }; - }); + async query() { + const isSetup = await auth.setup.checkIsSetup(); + + return { + status: isSetup, + title: config.title, + name: config.user_name, + email: config.user_email + }; } }, diff --git a/core/server/api/v2/authentication.js b/core/server/api/v2/authentication.js index 725cf0b1d1..ebbc6feba3 100644 --- a/core/server/api/v2/authentication.js +++ b/core/server/api/v2/authentication.js @@ -78,17 +78,15 @@ module.exports = { isSetup: { permissions: false, - query() { - return auth.setup.checkIsSetup() - .then((isSetup) => { - return { - status: isSetup, - // Pre-populate from config if, and only if the values exist in config. - title: config.title || undefined, - name: config.user_name || undefined, - email: config.user_email || undefined - }; - }); + async query() { + const isSetup = await auth.setup.checkIsSetup(); + + return { + status: isSetup, + title: config.title, + name: config.user_name, + email: config.user_email + }; } }, diff --git a/core/server/api/v3/authentication.js b/core/server/api/v3/authentication.js index 5877d52260..a6e9cbfef8 100644 --- a/core/server/api/v3/authentication.js +++ b/core/server/api/v3/authentication.js @@ -81,17 +81,15 @@ module.exports = { isSetup: { permissions: false, - query() { - return auth.setup.checkIsSetup() - .then((isSetup) => { - return { - status: isSetup, - // Pre-populate from config if, and only if the values exist in config. - title: config.title || undefined, - name: config.user_name || undefined, - email: config.user_email || undefined - }; - }); + async query() { + const isSetup = await auth.setup.checkIsSetup(); + + return { + status: isSetup, + title: config.title, + name: config.user_name, + email: config.user_email + }; } },