stack/examples/demo
Mantra 7f8e3df852
feat: add anonRefreshToken to CLI auth flow and enhance session management (#1303)
- Extended `CliAuthAttempt` with `anonRefreshToken` and a migration.
- CLI `POST /auth/cli` accepts optional `anon_refresh_token` (must be an
anonymous user's refresh token for the current project).
- `POST /auth/cli/complete` supports `mode` `check` (anonymous vs none),
`claim-anon-session` (issue tokens for the linked anonymous session),
and `complete` (bind the browser session's refresh token to the
attempt). Completing clears `anonRefreshToken` on the row. We do **not**
merge anonymous account data into the signed-in user (that behavior was
removed as a security risk; the anonymous user remains unchanged).
- Template CLI confirmation page, stack-cli optional
`STACK_CLI_ANON_REFRESH_TOKEN`, SDK/spec updates, and e2e coverage.

<!--

Make sure you've read the CONTRIBUTING.md guidelines:
https://github.com/stack-auth/stack-auth/blob/dev/CONTRIBUTING.md

-->


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* CLI login supports attaching anonymous sessions and a multi-mode
confirm/claim/check flow; CLI tools now surface login codes and remove
anon token after use.
  * Added interactive CLI auth demo page and a CLI simulator script.
* Client libraries: prompt flow accepts an optional anon token and a
promptLink(url, loginCode) callback.

* **Tests**
* Expanded end-to-end coverage for anonymous CLI sessions,
claim/complete/poll flows, upgrades, and error cases.

* **Documentation**
* Updated prompt CLI docs/spec to describe new options and callback
signature.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-04-14 02:09:35 +00:00
..
public Reworked Stack Auth demo (#624) 2025-04-15 02:03:07 +00:00
src feat: add anonRefreshToken to CLI auth flow and enhance session management (#1303) 2026-04-14 02:09:35 +00:00
.env updated self host vars, reduced the number of required env vars 2024-12-08 16:29:08 -08:00
.env.development New { type: "hosted" } for page URLs (#1261) 2026-03-27 14:48:01 -07:00
.eslintrc.js tsup for stack-shared (#647) 2025-04-28 21:26:52 -07:00
.gitignore Move examples to their own folder (#77) 2024-06-16 14:58:10 +02:00
cli-sim.mjs feat: add anonRefreshToken to CLI auth flow and enhance session management (#1303) 2026-04-14 02:09:35 +00:00
LICENSE Move examples to their own folder (#77) 2024-06-16 14:58:10 +02:00
next.config.js Upgrade Prisma to v7 (#1064) 2025-12-26 08:13:34 -08:00
package.json dev tool indicator (#1272) 2026-04-13 17:43:03 -07:00
postcss.config.js Move examples to their own folder (#77) 2024-06-16 14:58:10 +02:00
tailwind.config.js Support create-next-app@15 with the setup wizard (#340) 2024-11-13 13:58:42 +01:00
tsconfig.json New client (#135) 2024-07-19 22:07:44 -07:00