Remove config dependency in lib/authenticate

Restructure lib/authenticate to set the authentication secret at a later
point in time via setAuthSecret.  This breaks playerManager.
This commit is contained in:
Hornwitser committed 2019-09-04 17:36:06 +02:00
1 parent 8c1c8d07a9
commit af2471b427
5 files changed
+55 -27

No files matched your search

+3 -1
View File
@@ -36,7 +36,7 @@ const generateSSLcert = require("lib/generateSSLcert");
const getFactorioLocale = require("lib/getFactorioLocale");
// homemade express middleware for token auth
const authenticate = require("lib/authenticate")(config);
const authenticate = require("lib/authenticate");
const express = require("express");
const compression = require('compression');
@@ -921,6 +921,8 @@ async function startServer() {
// mod downloads
app.use(express.static(masterModFolder));
authenticate.setAuthSecret(config.masterAuthSecret);
// Make sure we're actually going to listen on a port
let httpPort = args.masterPort || config.masterPort;
let httpsPort = args.sslPort || config.sslPort;