whisper-money/app/Http
Víctor Falcón a346566fd0
feat(demo): gate demo account access behind a config flag (#580)
## What

Adds a `DEMO_ENABLED` env var (`config('app.demo.enabled')`, default
`true`) to fully toggle the demo account. Setting `DEMO_ENABLED=false`
in production blocks it without code changes.

When disabled:
- **Login is blocked** — `Fortify::authenticateUsing` rejects the demo
account with a generic credentials error (doesn't reveal the demo is
off). Regular users and 2FA are unaffected.
- **Landing link hidden** — the "Check Demo" button on the landing page
is removed (shared `demoEnabled` prop).
- **No credential prefill** — `demoCredentials` is only shared when
enabled, so `/login?demo=1` no longer autofills.

## Why

The demo account is publicly shared and gets abused (e.g. duplicate
votes on integration requests). This gives us a kill switch.

## Tests

Added to `DemoAccountRestrictionsTest`:
- demo account cannot log in when disabled
- demo account can log in when enabled
- regular user can still log in when demo is disabled

Existing auth + 2FA tests still pass.
2026-06-22 11:01:27 +00:00
..
Controllers feat(accounts): reorder accounts with drag-and-drop (#575) 2026-06-21 11:17:45 +02:00
Middleware feat(demo): gate demo account access behind a config flag (#580) 2026-06-22 11:01:27 +00:00
Requests feat(accounts): reorder accounts with drag-and-drop (#575) 2026-06-21 11:17:45 +02:00
Responses fix: route new PWA guests to signup (#313) 2026-04-21 10:53:05 +01:00