From c745572a7eb81fea3c1588a35af99e35964f0a26 Mon Sep 17 00:00:00 2001 From: knotteye Date: Thu, 30 Jul 2020 00:03:05 -0500 Subject: [PATCH] Update list of restricted usernames to avoid collision in api --- src/config.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/config.ts b/src/config.ts index f929fd9..27c0e31 100644 --- a/src/config.ts +++ b/src/config.ts @@ -1,6 +1,11 @@ import {parseAsYaml as parse} from "parse-yaml"; import {readFileSync as read} from "fs"; -var localconfig: Object = parse(read('config/config.yml')); +try { + var localconfig: Object = parse(read('config/config.yml')); +} catch (e) { + console.log('No config file found. Exiting.'); + process.exit(); +} const config: Object = { crypto: Object.assign({ saltRounds: 12 @@ -10,7 +15,7 @@ const config: Object = { domain: '', registration: false, email: null, - restrictedNames: [ 'live' ], + restrictedNames: [ 'live', 'user', 'users', 'register', 'login' ], rootredirect: '/users/live', version: process.env.npm_package_version, }, localconfig['satyr']),