# Forgejo saved-login discovery proof

The web scenario uses real fj 0.7.0 and two disposable Forgejo 13.0.5 instances. All accounts and data are synthetic. No mock CLI or HTTP response is used.

1. Download `forgejo-cli-x86_64-linux.tar.gz` from the forgejo-contrib/forgejo-cli v0.7.0 release on Codeberg and extract `fj` into a scratch directory. Make it discoverable to the app (this run symlinked it into the scenario checkout's `node_modules/.bin`, which `vp run` includes).
2. In that scratch directory generate a local CA (`ca.pem`, `ca-key.pem`) and a server key/certificate (`key.pem`, `cert.pem`) signed by that CA, with SAN `IP:127.0.0.1,DNS:localhost`, `basicConstraints=CA:FALSE`, and `extendedKeyUsage=serverAuth`. Make the server key readable by the disposable container user. Combine the system CA bundle and `ca.pem` into `trust.pem`.
3. In separate retained terminals run `python3 start-fixture.py <scratch> old` and `python3 start-fixture.py <scratch> new`. The fixture uses tmpfs for its database because the VM's Docker volume storage stalled SQLite initialization.
4. On each named container (`proof-38048-old`, `proof-38048-new`) run `docker exec --user git <container> forgejo admin user create --username proof-user --email proof@example.test --password ProofOnly-38048-Local --admin --must-change-password=false`. These are disposable local credentials, never a real account.
5. Run `python3 seed-logins.py <scratch>`. It creates tokens via the real Forgejo API, saves both through `fj auth add-token`, and revokes the first token. Its preflight must show exit 1 for port 18441 and exit 0 for port 18442.
6. Place `forgejo-saved-login.e2e.ts` in `scripts/scenarios/` on current main. Run the following from the checkout (replace `<scratch>`):

```sh
T3CODE_DEV_SEED=0 \
XDG_DATA_HOME=<scratch>/data \
SSL_CERT_FILE=<scratch>/trust.pem \
NODE_EXTRA_CA_CERTS=<scratch>/ca.pem \
T3_SCENARIO_INHERIT_ENV=XDG_DATA_HOME,SSL_CERT_FILE,NODE_EXTRA_CA_CERTS,T3CODE_DEV_SEED \
vp run scenarios:prove scripts/scenarios/forgejo-saved-login.e2e.ts \
  --base d35ec21cdd029ce6f97fa963e9a3263662fb1320 \
  --head 9696a8f7f2296aceb6102714a6294ae780f44b86 \
  --upload-command "ghdrop upload"
```

Both runs use new T3 databases, Chromium at 1280×800, light theme, the same no-remote synthetic project and the same saved logins. The assertion checks the Forgejo row's authentication summary. The provider offer switch is enabled on both revisions in this UI; it does not encode authentication.

Stop both fixture containers after the proof. Upload no keys, token store, database, or private certificates.
