Commit 90e871f
authored
Add: sandbox creation route under /sbx/new (#183)
<!-- CURSOR_SUMMARY -->
> [!NOTE]
> Adds an authenticated GET route at `/sbx/new` that creates an E2B
sandbox and redirects to its inspect page, with error handling and
sign-in redirects.
>
> - **Routes**:
> - **New GET** `src/app/sbx/new/route.ts`
> - Auth guard via Supabase (`createClient`, `auth.getUser`) and
`getSessionInsecure`; redirects to `AUTH_URLS.SIGN_IN` with `returnTo`
if unauthenticated.
> - Fetches default team with `getDefaultTeam` and creates E2B sandbox
via `Sandbox.create('base', { domain: env, headers:
SUPABASE_AUTH_HEADERS(token, teamId) })`.
> - Redirects to `PROTECTED_URLS.SANDBOX_INSPECT(teamSlug, sandboxId)`
on success.
> - On error: logs (`l.warn` with `serializeError`) and redirects to
request origin.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
d322ab9. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 95fbd03 commit 90e871f
1 file changed
+64
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
0 commit comments