diff --git a/scripts/local_vars.sh b/scripts/local_vars.sh index b1b285c00..c452b87a1 100644 --- a/scripts/local_vars.sh +++ b/scripts/local_vars.sh @@ -9,5 +9,8 @@ export SESSION_SECRET="session secret" export REACT_APP_NOMOCK=on # shellcheck disable=SC2155 export DB_PATH="$(pwd)/nodes/llmdb" +# The following two variables can be set to see log output from dela: #export PROXY_LOG=info #export LLVL=info +# If this is set, you can login without Gaspar +export REACT_APP_DEV_LOGIN="true" \ No newline at end of file diff --git a/web/backend/src/controllers/authentication.ts b/web/backend/src/controllers/authentication.ts index 2136c81b2..b60beb3f7 100644 --- a/web/backend/src/controllers/authentication.ts +++ b/web/backend/src/controllers/authentication.ts @@ -6,8 +6,8 @@ import { getUserPermissions, readSCIPER, setMapAuthorization } from '../authMana export const authenticationRouter = express.Router(); authenticationRouter.get('/get_dev_login', (req, res) => { - if (process.env.NODE_ENV !== 'development') { - const err = `/get_dev_login can only be called in development: ${process.env.NODE_ENV}`; + if (process.env.REACT_APP_DEV_LOGIN !== 'true') { + const err = `/get_dev_login can only be called with DEV_LOGIN===true: ${process.env.DEV_LOGIN}`; console.error(err); res.status(500).send(err); return; diff --git a/web/frontend/src/pages/session/HandleLogin.tsx b/web/frontend/src/pages/session/HandleLogin.tsx index 88d5326b1..0b0891dbd 100644 --- a/web/frontend/src/pages/session/HandleLogin.tsx +++ b/web/frontend/src/pages/session/HandleLogin.tsx @@ -3,10 +3,11 @@ import { FlashLevel, FlashState } from 'index'; // The backend will provide the client the URL to make a Tequila authentication. // We therefore redirect to this address. +// If REACT_APP_DEV_LOGIN === "true", we allow an automatic login with SCIPER 100100. const handleLogin = async (fctx: FlashState) => { try { let res; - if (process.env.NODE_ENV === 'development') { + if (process.env.REACT_APP_DEV_LOGIN === 'true') { await fetch(ENDPOINT_DEV_LOGIN); window.location.reload(); return;