diff --git a/compose.yaml b/compose.yaml index d26f196..6626c2d 100644 --- a/compose.yaml +++ b/compose.yaml @@ -20,6 +20,7 @@ services: NENE_DB_USER: "${NENE_DB_USER:-nene}" NENE_DB_PASS: "${NENE_DB_PASS:-nene}" NENE_SAMPLE_ADMIN_PASSWORD: "${NENE_SAMPLE_ADMIN_PASSWORD:-admin}" + NENE_LOGOUT_URI: "${NENE_LOGOUT_URI:-/}" ports: - "${NENE_PORT:-8080}:80" volumes: diff --git a/docs/development/docker.md b/docs/development/docker.md index 8cc81de..d065c40 100644 --- a/docs/development/docker.md +++ b/docs/development/docker.md @@ -70,6 +70,14 @@ Use another phpMyAdmin port if needed: NENE_PHPMYADMIN_PORT=8083 docker compose up --build ``` +Override the unauthenticated redirect target if your app has a custom login page: + +```sh +NENE_LOGOUT_URI=/auth/login docker compose up --build +``` + +`LOGOUT_URI` is used by `ControllerBase::sessionCheck()` when an unauthenticated visitor hits an HTML page that requires login. The default `/` sends them to the site root; set this to your login URL (e.g. `/auth/login`) so they land on a useful page instead of the index splash. + ## Session Cookie Settings The app explicitly configures PHP session Cookie attributes before `session_start()`: diff --git a/ini/xSystemIni.php b/ini/xSystemIni.php index 9c5ca52..507cf97 100644 --- a/ini/xSystemIni.php +++ b/ini/xSystemIni.php @@ -122,7 +122,7 @@ const OWN_DOMAIN = 'localhost'; const URI_ROOT = '/'; const LAYERS_NUM = 0; -const LOGOUT_URI = '/'; +define('LOGOUT_URI', $getEnv('NENE_LOGOUT_URI', '/')); /* * Public assets.