## What kind of change does this PR introduce?
Bug fix. Resolves DEPR-318.
## What is the current behavior?
New users who confirm their email land on `/sign-in`, then
`/organizations`, then get bounced to `/new` via a `useEffect`.
Cancelling org creation with zero orgs sends them back to
`/organizations`, which immediately redirects into `/new` again.
## What is the new behavior?
- Signup email verification redirects to `/new` directly
- `/organizations` with zero orgs shows the existing empty state instead
of force-redirecting
## To test
### One-time setup
Assuming you don’t already have a staging account with **zero** orgs:
1. On **supabase.green**, sign up with a fresh email and confirm it
2. Stop at org creation. Do **not** create an org
### On this PR
Using the [studio-staging
preview](https://studio-staging-git-dnywh-fixremove-org-redirect-supabase.vercel.app/)
from Vercel checks:
4. Sign in on the preview with that account
5. Open `/dashboard/organizations`. Expect the **Create an
organization** empty state, with no redirect to `/new`
6. Open `/dashboard/new`, click **Cancel**. Expect to land on
`/organizations` and stay there
### Compare on supabase.green
Optional. Just to show what happens currently on `master`:
7. Repeat steps 3–5 on **supabase.green**. `/organizations` should
bounce to `/new`, and **Cancel** should send you back into org creation
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Bug Fixes**
* Improved signup redirects by preserving valid destinations and
relevant query parameters.
* Added safer fallback behavior for missing, invalid, or unsupported
destinations.
* Improved handling of signup redirects provided in multiple formats.
* Prevented automatic redirection from the organizations page when no
organizations exist.
* **Style**
* Updated the organizations page title capitalization for consistency.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Use getClaims instead of getUser which avoids a network call to GoTrue to validate the user in case of asymmetric keys - this shaves off a good amount of latency for every API call.
* refine regex in returnTo filter
* update regex and add tests
* update vite config
* new test
* anotherone
* add imports idk why ts doesnt catch this for me locally
* add empty space
---------
Co-authored-by: Jordi Enric <jordi.err@gmail.com>
* fix: bump auth-js version to v2.67.3
* chore: add supabase/auth and supabase/dashboard as codeowners
* Revert "chore: add supabase/auth and supabase/dashboard as codeowners"
This reverts commit 57fc5776ba.
* bump supabase-js version
* import user type from single gotrue
* fix auth-js version in studio
* remove auth-js dep in studio
* fix ts
* use catalog versions
* fix ts
* Bump realtime-js version to avoid having 2 versions.
* Add @supabase/realtime-js to the pnpm catalog.
* upgrade realtime-js
---------
Co-authored-by: Alaister Young <a@alaisteryoung.com>
Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
* Move all studio files from /studio to /apps/studio.
* Move studio specific prettier ignores.
* Fix the ui references from studio.
* Fix the css imports.
* Fix all package.json issues.
* Fix the prettier setup for the studio app.
* Add .turbo folder to prettierignore.
* Fix the github workflows.