bugfix: the flow for trial and accept invitation (org + staff)is now unified. all navigate to dshboard if succesfull.
This commit is contained in:
@@ -53,10 +53,13 @@ Task status updates use **`PATCH /tasks/:id`** (not token routes) — same assig
|
||||
Helpers: `lib/auth/postAuthRedirect.ts` (`sessionStorage` key `authRedirect`).
|
||||
|
||||
1. Logged-out user hits `/lab-case/{token}` → dashboard layout stores path + `router.replace('/login?from=…')`.
|
||||
2. Login page `useSearchParams` (inside **Suspense**) calls `storeAuthRedirectFromPath(from)`.
|
||||
3. After login + org ready: **one** `consumeAuthRedirect()` on login page (wait for `!isLoading` and org selected).
|
||||
4. **Do not** `consumeAuthRedirect()` inside `useAuth.login()` — double consume sends user to `/today`.
|
||||
5. Multi-org: redirect stays in storage until `selectOrganization()` consumes it.
|
||||
2. Login page `useSearchParams` (inside **Suspense**) calls `storeAuthRedirectFromPath(from)` **before** `useEnterAppWhenAuthenticated`.
|
||||
3. After login/register + org ready: **one** consume via `appPathAfterAuth()` in that hook. Staff/org invite: `login()` then `navigateIntoAppIfOrgSelected` (❌ no hook on invite pages).
|
||||
4. **Do not** `consumeAuthRedirect()` inside `useAuth.login()` or `registerTrial` — double consume sends user to `/today`.
|
||||
5. Multi-org: redirect stays in storage until `selectOrganization()` → `appPathAfterAuth()`.
|
||||
6. Forgot-password navigates to account reset itself — do not add the enter-app hook there.
|
||||
|
||||
Rule: `.cursor/rules/post-auth-navigation.mdc`.
|
||||
|
||||
## Tasks tab interaction
|
||||
|
||||
|
||||
Reference in New Issue
Block a user