stack/packages/template/src/lib/stack-app
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
..
api-keys Api Keys (#590) 2025-04-04 13:03:10 -07:00
apps feat: add anonRefreshToken to CLI auth flow and enhance session management (#1303) 2026-04-14 02:09:35 +00:00
connected-accounts More connected accounts (#1165) 2026-02-18 15:19:35 -08:00
contact-channels Improve user profile page (#712) 2025-07-02 02:59:12 +02:00
customers inline product cancelling (#1199) 2026-02-17 20:28:16 -08:00
data-vault Data vaults (#871) 2025-08-30 23:42:56 -07:00
email [Refactor][Feat][Fix] Rework Email Section With New Sent Page, Better Drafts Page, and Settings Page (#1221) 2026-03-11 12:01:36 -07:00
email-templates Split stack-app.ts file into multiple files (#492) 2025-03-02 21:20:42 -08:00
internal-api-keys Fix package build with explicit index.js imports (#677) 2025-05-15 23:55:59 +02:00
notification-categories Send email route and notification settings page (#717) 2025-07-01 19:17:53 -07:00
permissions Config DB migration step 2 (#629) 2025-04-29 14:52:45 -07:00
project-configs [Fix] [Feat] Update OAuth Sign-In and Get Token Functions to Work (#1130) 2026-01-28 02:17:27 +00:00
projects Add onboarding status to Project model and implement related database… (#1246) 2026-03-13 12:00:40 -07:00
session-replays analytics replay filters (#1213) 2026-02-24 13:00:45 -08:00
teams Add server-side flags for anonymous users 2026-04-03 10:43:34 -07:00
users Turnstile integration for fraud protection (#1239) 2026-03-20 21:26:45 +00:00
common.ts Fix session recorder and even tracker access token fetch (#1331) 2026-04-13 18:32:24 -07:00
index.ts dev tool indicator (#1272) 2026-04-13 17:43:03 -07:00
url-targets.test.ts dev tool indicator (#1272) 2026-04-13 17:43:03 -07:00
url-targets.ts dev tool indicator (#1272) 2026-04-13 17:43:03 -07:00