aboutsummaryrefslogtreecommitdiff
path: root/src/api/routes/auth/registerPOST.js
diff options
context:
space:
mode:
authorPitu <[email protected]>2021-06-15 00:12:26 +0900
committerPitu <[email protected]>2021-06-15 00:12:26 +0900
commitd3c80127ecdc83cffb9ba9a05f47452fec60287c (patch)
treefb056e08947393a6487238b247703565f049a149 /src/api/routes/auth/registerPOST.js
parentchore: get host from req instead of config (diff)
downloadhost.fuwn.me-d3c80127ecdc83cffb9ba9a05f47452fec60287c.tar.xz
host.fuwn.me-d3c80127ecdc83cffb9ba9a05f47452fec60287c.zip
chore: update process.env usage
Diffstat (limited to 'src/api/routes/auth/registerPOST.js')
-rw-r--r--src/api/routes/auth/registerPOST.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/api/routes/auth/registerPOST.js b/src/api/routes/auth/registerPOST.js
index 7b9eb3c..e740c83 100644
--- a/src/api/routes/auth/registerPOST.js
+++ b/src/api/routes/auth/registerPOST.js
@@ -12,7 +12,7 @@ class registerPOST extends Route {
async run(req, res, db) {
// Only allow admins to create new accounts if the sign up is deactivated
const user = await Util.isAuthorized(req);
- if ((!user || !user.isAdmin) && process.env.USER_ACCOUNTS === 'false') return res.status(401).json({ message: 'Creation of new accounts is currently disabled' });
+ if ((!user || !user.isAdmin) && !Util.config.userAccounts) return res.status(401).json({ message: 'Creation of new accounts is currently disabled' });
if (!req.body) return res.status(400).json({ message: 'No body provided' });
const { username, password } = req.body;