diff --git a/.envdev b/.envdev index 425e90e..230ad5d 100644 --- a/.envdev +++ b/.envdev @@ -2,6 +2,7 @@ WEB_PROTOCOL=http WEB_ADDRESS=localhost WEB_RESET_ADDRESS=localhost/reset WEB_PORT=3200 +WEB_ORIGIN=http://localhost:3001 DB_HOSTNAME=database DB_DATABASE=auth diff --git a/configure-script.js b/configure-script.js index 5ae5ee7..dbc10f3 100644 --- a/configure-script.js +++ b/configure-script.js @@ -29,8 +29,9 @@ const question = (prompt, def = null) => { (async () => { //project configuration const appName = await question('App Name', 'auth'); - const appWebOrigin = await question('Web Origin', `example.com`); - const appWebAddress = await question('Web Addr', `${appName}.${appWebOrigin}`); + const appWebProtocol = await question('Web Protocol', 'https'); + const appWebOrigin = await question('Web Origin', `${appWebProtocol}://example.com`); //TODO: clean these up properly + const appWebAddress = await question('Web Addr', `${appName}.example.com`); const postValidationHookArray = await question('Post Validation Hook Array', ''); const resetAddress = await question('Reset Addr', `example.com/reset`); const appPort = await question('App Port', '3200'); @@ -70,7 +71,7 @@ services: - "traefik.http.routers.${appName}router.service=${appName}service@docker" - "traefik.http.services.${appName}service.loadbalancer.server.port=${appPort}" environment: - - WEB_PROTOCOL=https + - WEB_PROTOCOL=${appWebProtocol} - WEB_ORIGIN=${appWebOrigin} - WEB_ADDRESS=${appWebAddress} - HOOK_POST_VALIDATION_ARRAY=${postValidationHookArray} diff --git a/package-lock.json b/package-lock.json index 239164f..f4faec1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "auth-server", - "version": "1.6.1", + "version": "1.6.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "auth-server", - "version": "1.6.1", + "version": "1.6.2", "license": "ISC", "dependencies": { "bcryptjs": "^2.4.3", diff --git a/package.json b/package.json index aaa4841..95672bd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "auth-server", - "version": "1.6.1", + "version": "1.6.2", "description": "An API centric auth server. Uses Sequelize and mariaDB by default.", "main": "server/server.js", "scripts": { diff --git a/server/server.js b/server/server.js index 07903af..1927d24 100644 --- a/server/server.js +++ b/server/server.js @@ -13,7 +13,7 @@ app.use(express.json()); app.use(cors({ credentials: true, - origin: [`${process.env.WEB_PROTOCOL}://${process.env.WEB_ORIGIN}`], + origin: [`${process.env.WEB_ORIGIN}`], allowedHeaders: ['Origin', 'X-Requested-With', 'Content-Type', 'Accept', 'Authorization', 'Set-Cookie'], exposedHeaders: ['Origin', 'X-Requested-With', 'Content-Type', 'Accept', 'Authorization', 'Set-Cookie'], }));