From 9f4414f68c574c2790609801d6c864905d7127c5 Mon Sep 17 00:00:00 2001 From: "C. Fuhrman" Date: Thu, 6 Mar 2025 12:03:18 -0500 Subject: [PATCH] Supporter simpleauth lorsque mode development --- server/auth_config-development.json | 9 +++++++++ server/config/auth.js | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 server/auth_config-development.json diff --git a/server/auth_config-development.json b/server/auth_config-development.json new file mode 100644 index 0000000..6d53c7e --- /dev/null +++ b/server/auth_config-development.json @@ -0,0 +1,9 @@ +{ + "auth": { + "simpleauth": { + "enabled": true, + "name": "provider3", + "SESSION_SECRET": "your_session_secret" + } + } +} diff --git a/server/config/auth.js b/server/config/auth.js index 0bec1b1..b993def 100644 --- a/server/config/auth.js +++ b/server/config/auth.js @@ -1,6 +1,7 @@ const fs = require('fs'); const path = require('path'); -const pathAuthConfig = './auth_config.json'; +// set pathAuthConfig to './auth_config-development.json' if NODE_ENV is set to development +const pathAuthConfig = process.env.NODE_ENV === 'development' ? './auth_config-development.json' : './auth_config.json'; const configPath = path.join(process.cwd(), pathAuthConfig);