stack/apps/dashboard/src/components
Mantra 63d0eeefe9
fix(dashboard,backend): impersonation without logout + fix OAuth routing (#1617)
## Summary

Two fixes:

**1. Impersonation no longer requires logout** — The generated JS
snippet now clears all auth cookie variants (`hexclave-refresh-{pid}*`,
`stack-refresh-{pid}*`, access tokens) and sets the token in the
structured `hexclave-refresh-{pid}--default` format the SDK reads first.
Previously the snippet only set the legacy cookie, which was ignored
when a structured cookie already existed.

**2. Fix OAuth + other deeply nested API routes returning 404 in dev** —
Moved the API 404 handler from file-based
`api/[...notFoundPath]/route.ts` into the middleware (`proxy.tsx`). The
catch-all at the `api/` level was shadowing dynamic routes 7+ segments
deep (e.g. `auth/oauth/authorize/[provider_id]`) in Turbopack dev mode
(Next.js 16.2.7). The middleware already has `routes` + `SmartRouter`,
so it checks for a match before rewriting and returns the custom 404
directly when nothing matches.

Link to Devin session:
https://app.devin.ai/sessions/d9dcb2d203aa4a6ea36c8cdd2a4a42c2
Requested by: @mantrakp04

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

* **Documentation**
* Updated the user impersonation dialog to explicitly state that the
pasted console snippet will replace your current session with the
impersonated user’s session.
* **Refactor**
* Standardized the impersonation console snippet generation to use a
shared token-based approach, including proper expiration handling.
* **Bug Fixes**
* Improved reliability of the impersonation flow by failing when the
required refresh token is unavailable, preventing incomplete snippet
generation.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: mantra <mantra@stack-auth.com>
2026-06-18 17:13:06 -07:00
..
assistant-ui Consistency and design changes light mode (#1500) 2026-06-05 10:57:13 -07:00
commands fix: update AI model selection matrix and custom dashboard generation (#1615) 2026-06-17 15:38:28 -07:00
dashboard-account-settings Consistency and design changes light mode (#1500) 2026-06-05 10:57:13 -07:00
data-table fix(dashboard,backend): impersonation without logout + fix OAuth routing (#1617) 2026-06-18 17:13:06 -07:00
design-components Consistency and design changes light mode (#1500) 2026-06-05 10:57:13 -07:00
form-fields feat(hexclave): PR 3 — native @hexclave/* source rename + delete dual-publish wiring (#1482) 2026-05-29 15:21:59 -07:00
hexclave-companion feat(hexclave): PR 5 — internal symbol/path/package renames + brand strings (#1547) 2026-06-03 18:57:09 -07:00
pacifica feat(hexclave): PR 5 — internal symbol/path/package renames + brand strings (#1547) 2026-06-03 18:57:09 -07:00
payments Payments minor navigation and UI bugs fixed (#1585) 2026-06-11 11:38:00 -07:00
rule-builder Consistency and design changes light mode (#1500) 2026-06-05 10:57:13 -07:00
ui feat(analytics): add route analytics heatmaps (#1520) 2026-06-15 12:06:16 -07:00
vibe-coding fix: update AI model selection matrix and custom dashboard generation (#1615) 2026-06-17 15:38:28 -07:00
walkthrough Speed up dummy-project seeding (preview create-project ~15s → ~1.3s) (#1437) 2026-05-20 10:10:22 -07:00
app-square.tsx Make it clear there are more SDK packages 2026-06-16 10:37:58 -07:00
app-store-entry.tsx Make it clear there are more SDK packages 2026-06-16 10:37:58 -07:00
app-warning-modal.tsx [UI] - Updates all Icons to Phosphor Icons (#1066) 2025-12-22 10:43:45 -06:00
cmdk-commands.tsx Make it clear there are more SDK packages 2026-06-16 10:37:58 -07:00
cmdk-search.tsx feat(hexclave): PR 3 — native @hexclave/* source rename + delete dual-publish wiring (#1482) 2026-05-29 15:21:59 -07:00
code-block.tsx Overview revamp (#1238) 2026-04-15 09:36:00 -07:00
confetti.tsx feat(hexclave): PR 3 — native @hexclave/* source rename + delete dual-publish wiring (#1482) 2026-05-29 15:21:59 -07:00
copyable-text.tsx feat(hexclave): PR 3 — native @hexclave/* source rename + delete dual-publish wiring (#1482) 2026-05-29 15:21:59 -07:00
country-code-select.tsx Consistency and design changes light mode (#1500) 2026-06-05 10:57:13 -07:00
dashboard-user-button.tsx Make UserButton render a glyph again when user is not signed in 2026-06-17 11:35:04 -07:00
dev-error-notifier.tsx feat(hexclave): PR 3 — native @hexclave/* source rename + delete dual-publish wiring (#1482) 2026-05-29 15:21:59 -07:00
dialog-opener.tsx Payments redesign (#1045) 2025-12-17 16:34:17 -08:00
editable-grid.tsx feat(hexclave): PR 3 — native @hexclave/* source rename + delete dual-publish wiring (#1482) 2026-05-29 15:21:59 -07:00
editable-input.tsx feat(hexclave): PR 3 — native @hexclave/* source rename + delete dual-publish wiring (#1482) 2026-05-29 15:21:59 -07:00
email-preview.tsx feat(hexclave): PR 5 — internal symbol/path/package renames + brand strings (#1547) 2026-06-03 18:57:09 -07:00
email-theme-selector.tsx feat(hexclave): PR 5 — internal symbol/path/package renames + brand strings (#1547) 2026-06-03 18:57:09 -07:00
email-verification-setting.tsx feat(hexclave): PR 5 — internal symbol/path/package renames + brand strings (#1547) 2026-06-03 18:57:09 -07:00
entity-kpi-cards.tsx feat(hexclave): PR 5 — internal symbol/path/package renames + brand strings (#1547) 2026-06-03 18:57:09 -07:00
env-keys.tsx PR 4: Rename Stack -> Hexclave: examples config module, app-internal symbols, crypto docs (#1534) 2026-06-03 12:09:20 -07:00
error-page.tsx Payments redesign (#1045) 2025-12-17 16:34:17 -08:00
export-users-dialog.tsx feat(hexclave): PR 5 — internal symbol/path/package renames + brand strings (#1547) 2026-06-03 18:57:09 -07:00
feedback-form.tsx feat(hexclave): PR 3 — native @hexclave/* source rename + delete dual-publish wiring (#1482) 2026-05-29 15:21:59 -07:00
form-dialog.tsx feat(hexclave): PR 3 — native @hexclave/* source rename + delete dual-publish wiring (#1482) 2026-05-29 15:21:59 -07:00
form-fields.tsx Payments checkout page redesign (#1536) 2026-06-05 10:08:33 -07:00
hexclave-companion.tsx feat(hexclave): PR 5 — internal symbol/path/package renames + brand strings (#1547) 2026-06-03 18:57:09 -07:00
hexclave-rebrand-modal.tsx feat(hexclave): PR 3 — native @hexclave/* source rename + delete dual-publish wiring (#1482) 2026-05-29 15:21:59 -07:00
illustrated-info.tsx Payments redesign (#1045) 2025-12-17 16:34:17 -08:00
inline-code.tsx Onboarding app & restricted users (#1069) 2026-01-11 17:22:14 -08:00
inline-save-discard.tsx feat(hexclave): PR 3 — native @hexclave/* source rename + delete dual-publish wiring (#1482) 2026-05-29 15:21:59 -07:00
link.tsx Dashboard redesign (#1029) 2025-11-28 13:21:18 -08:00
logo-upload.tsx feat(hexclave): PR 3 — native @hexclave/* source rename + delete dual-publish wiring (#1482) 2026-05-29 15:21:59 -07:00
logo.tsx Update logo 2025-03-31 13:20:35 -07:00
metadata-editor.tsx feat(hexclave): PR 3 — native @hexclave/* source rename + delete dual-publish wiring (#1482) 2026-05-29 15:21:59 -07:00
navbar.tsx Consistency and design changes light mode (#1500) 2026-06-05 10:57:13 -07:00
permission-field.tsx feat(hexclave): PR 3 — native @hexclave/* source rename + delete dual-publish wiring (#1482) 2026-05-29 15:21:59 -07:00
project-card.tsx feat(hexclave): PR 3 — native @hexclave/* source rename + delete dual-publish wiring (#1482) 2026-05-29 15:21:59 -07:00
project-switcher.tsx Remote dev envs (#1435) 2026-05-19 15:54:18 -07:00
project-transfer-confirm-view.tsx feat(hexclave): PR 3 — native @hexclave/* source rename + delete dual-publish wiring (#1482) 2026-05-29 15:21:59 -07:00
project-users-metric.tsx Onboarding app redesign (#1370) 2026-05-20 13:10:22 -07:00
repeating-input.tsx feat(hexclave): PR 3 — native @hexclave/* source rename + delete dual-publish wiring (#1482) 2026-05-29 15:21:59 -07:00
resizable-container.tsx Emails redesign (#1076) 2026-02-16 14:57:17 -08:00
router.tsx feat(hexclave): PR 3 — native @hexclave/* source rename + delete dual-publish wiring (#1482) 2026-05-29 15:21:59 -07:00
search-bar.tsx feat(hexclave): PR 3 — native @hexclave/* source rename + delete dual-publish wiring (#1482) 2026-05-29 15:21:59 -07:00
settings.tsx Consistency and design changes light mode (#1500) 2026-06-05 10:57:13 -07:00
site-loading-indicator.tsx Glassy dashboard style (#411) 2025-02-03 10:03:35 -08:00
smart-form.tsx feat(hexclave): PR 3 — native @hexclave/* source rename + delete dual-publish wiring (#1482) 2026-05-29 15:21:59 -07:00
smart-image.tsx Split backend and dashboard (#83) 2024-06-18 15:49:31 +02:00
stepper.tsx stepper ui fix (#881) 2025-09-09 19:21:48 -07:00
streaming-code-viewer.tsx Overview revamp (#1238) 2026-04-15 09:36:00 -07:00
stripe-wordmark.tsx Onboarding redo (#1308) 2026-04-15 09:35:48 -07:00
style-link.tsx Split backend and dashboard (#83) 2024-06-18 15:49:31 +02:00
theme-toggle.tsx feat(hexclave): PR 3 — native @hexclave/* source rename + delete dual-publish wiring (#1482) 2026-05-29 15:21:59 -07:00
user-dialog.tsx fix: clearer error when changing email to one already used for auth (#1569) 2026-06-15 13:55:26 -07:00
user-dialogs.tsx fix(dashboard,backend): impersonation without logout + fix OAuth routing (#1617) 2026-06-18 17:13:06 -07:00
version-alerter.tsx Feature/stack companion (#769) 2025-08-12 15:12:20 -05:00