Commit 7ebbfd6
authored
Refactor: Supabase admin migration (#273)
<!-- CURSOR_SUMMARY -->
> [!NOTE]
> **High Risk**
> High risk because it rewires team resolution/authorization to be
slug-based across dashboard routes and API handlers, including
auth/session plumbing and new repository layers; mistakes could break
access control or routing for existing users.
>
> **Overview**
> Moves the app to **slug-only team routing**: dashboard pages, redirect
resolvers (e.g. `/dashboard`, `/dashboard/account`), and team-scoped API
routes now take `teamSlug` and resolve/authorize to a team ID via
`getTeamIdFromSlug`/`resolveUserTeam`, removing ID fallbacks and
hardening tab redirects with `Object.hasOwn`.
>
> Introduces a set of `core/modules/*` repositories and models (auth,
teams, sandboxes, builds, keys, billing, support) and updates
imports/tests to use the new `core/shared` clients/contracts paths; adds
a client-side `DashboardTeamGate` with prefetched `teams.list` to
enforce access in the new `dashboard/[teamSlug]/layout`.
>
> Removes several old SQL migration files and shifts the `/api/health`
check from a direct Supabase query to calling the dashboard API
`/health` endpoint.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
ab45405. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent c3fb2d5 commit 7ebbfd6
File tree
318 files changed
+6137
-6742
lines changed- migrations
- src
- __test__
- integration
- unit
- app
- (auth)
- auth/cli
- confirm
- forgot-password
- sign-in
- sign-up
- (rewrites)/[[...slug]]
- api
- auth
- callback
- confirm
- email-callback
- verify-otp
- health
- teams
- [teamId]/sandboxes/metrics
- [teamSlug]/metrics
- user
- trpc/[trpc]
- dashboard
- (resolvers)/inspect/sandbox/[sandboxId]
- [teamIdOrSlug]
- sandboxes/[sandboxId]/logs
- [teamSlug]
- account
- billing
- plan
- select
- general
- keys
- limits
- members
- sandboxes
- (tabs)
- @list
- @monitoring
- [sandboxId]
- filesystem
- logs
- monitoring
- templates
- (tabs)
- @builds
- @list
- [templateId]/builds/[buildId]
- usage
- webhooks
- account
- sbx/new
- configs
- core
- application/teams
- modules
- auth
- billing
- builds
- keys
- sandboxes
- support
- teams
- templates
- webhooks
- server
- actions
- adapters
- api
- middlewares
- routers
- functions
- auth
- keys
- sandboxes
- team
- usage
- webhooks
- http
- trpc
- features
- auth
- dashboard
- account
- billing
- build
- layouts
- limits
- members
- sandboxes
- list
- hooks
- stores
- monitoring
- charts
- concurrent-chart
- startrate-chart
- team-metrics-chart
- hooks
- sandbox
- header
- inspect
- logs
- monitoring
- components
- state
- utils
- settings
- general
- keys
- webhooks
- sidebar
- templates
- builds
- list
- usage
- lib
- captcha
- clients
- hooks
- schemas
- utils
- server
- api
- repositories
- routers
- auth
- keys
- team
- usage
- webhooks
- trpc
- types
- ui
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
318 files changed
+6137
-6742
lines changedThis file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
0 commit comments