create-nextblock 0.12.13 → 0.12.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/templates/nextblock-template/app/(auth-pages)/sign-in/page.tsx +0 -13
- package/templates/nextblock-template/app/(auth-pages)/sign-up/SignUpForm.tsx +0 -14
- package/templates/nextblock-template/app/api/cron/reset-sandbox/sandboxResetSql.ts +184 -101
- package/templates/nextblock-template/app/cms/CmsClientLayout.tsx +2 -3
- package/templates/nextblock-template/app/cms/interactions/InteractionsModerationClient.tsx +1 -1
- package/templates/nextblock-template/app/cms/interactions/page.tsx +1 -1
- package/templates/nextblock-template/app/cms/revisions/RevisionHistoryButton.tsx +2 -2
- package/templates/nextblock-template/app/cms/revisions/actions.ts +5 -5
- package/templates/nextblock-template/app/cms/users/actions.ts +0 -3
- package/templates/nextblock-template/app/cms/users/components/UserForm.tsx +0 -2
- package/templates/nextblock-template/app/cms/users/page.tsx +0 -2
- package/templates/nextblock-template/app/profile/ProfileAccountSidebar.tsx +1 -1
- package/templates/nextblock-template/app/profile/account-data.ts +1 -1
- package/templates/nextblock-template/app/profile/account-types.ts +0 -1
- package/templates/nextblock-template/app/profile/page.tsx +0 -1
- package/templates/nextblock-template/components/PostCommentsSection.tsx +2 -2
- package/templates/nextblock-template/components/ProductReviewsSection.tsx +2 -2
- package/templates/nextblock-template/components/header-auth.tsx +1 -1
- package/templates/nextblock-template/docs/TECHNICAL_SPECIFICATION.md +30 -32
- package/templates/nextblock-template/lib/custom-block-relation-registry.ts +3 -3
- package/templates/nextblock-template/lib/setup/migrations-bundle.ts +72 -37
- package/templates/nextblock-template/package.json +1 -1
- package/templates/nextblock-template/components/GitHubLoginButton.tsx +0 -36
|
@@ -79,7 +79,7 @@ export default function ProductReviewsSection({ productId }: ProductReviewsSecti
|
|
|
79
79
|
try {
|
|
80
80
|
const { data, error: dbError } = await supabase
|
|
81
81
|
.from("cms_interactions" as any)
|
|
82
|
-
.select("*, profiles(full_name, avatar_url
|
|
82
|
+
.select("*, profiles(full_name, avatar_url)")
|
|
83
83
|
.eq("product_id", productId)
|
|
84
84
|
.eq("type", "review")
|
|
85
85
|
.eq("status", "approved")
|
|
@@ -317,7 +317,7 @@ export default function ProductReviewsSection({ productId }: ProductReviewsSecti
|
|
|
317
317
|
optimisticReviews.map((review) => {
|
|
318
318
|
const hasLiked = likedIds.includes(review.id) || review.tempHasReacted;
|
|
319
319
|
const likeCount = (review.reactions as Record<string, number>)?.likes || 0;
|
|
320
|
-
const reviewerName = review.profiles?.full_name ||
|
|
320
|
+
const reviewerName = review.profiles?.full_name || "Anonymous";
|
|
321
321
|
const dateStr = new Date(review.created_at).toLocaleDateString(lang, {
|
|
322
322
|
year: "numeric",
|
|
323
323
|
month: "long",
|
|
@@ -20,7 +20,7 @@ import { User, LogOut, LayoutDashboard } from "lucide-react";
|
|
|
20
20
|
export default function AuthButton() {
|
|
21
21
|
const { user, profile, isAdmin, isWriter } = useAuth();
|
|
22
22
|
const { t } = useTranslations();
|
|
23
|
-
const displayName = profile?.full_name ||
|
|
23
|
+
const displayName = profile?.full_name || user?.email || null;
|
|
24
24
|
const showAdminLink = isAdmin || isWriter;
|
|
25
25
|
|
|
26
26
|
const handleSignOut = async () => {
|
|
@@ -95,7 +95,7 @@ NextBlock CMS integrates with a specific, opinionated set of external services w
|
|
|
95
95
|
The system delivers six top-level capability families, each surfaced through dedicated route groups in the Next.js App Router:
|
|
96
96
|
|
|
97
97
|
1. **Public Content Delivery** — Routes `app/[slug]`, `app/article/[slug]`, shared `app/layout.tsx`, `robots.txt`, and `sitemap.xml` serve marketing pages, articles, and product pages.
|
|
98
|
-
2. **Authentication & Account Management** — The `app/(auth-pages)/*` group and `app/auth/callback/route.ts` implement Supabase Auth session exchange
|
|
98
|
+
2. **Authentication & Account Management** — The `app/(auth-pages)/*` group and `app/auth/callback/route.ts` implement Supabase Auth email/password session exchange and profile completion flows.
|
|
99
99
|
3. **CMS Administration** — The `app/cms/*` route tree provides block editing, media management, product catalog management, order administration, shipping configuration, tax settings, and user administration, gated by role.
|
|
100
100
|
4. **Commerce Surface** — Routes `app/product/*`, `app/cart`, and `app/checkout` implement the customer-facing storefront; `app/api/checkout/route.ts` handles server-side checkout orchestration.
|
|
101
101
|
5. **Operational Endpoints** — Routes `app/api/webhooks/*` (Stripe/Freemius) and `app/api/cron/*` (sandbox reset, currency sync) provide the machine-to-machine surface; `app/api/upload` and `app/api/process-image` handle media ingestion and optimization.
|
|
@@ -390,7 +390,7 @@ Based on claims and deferred items in the repository documentation, the followin
|
|
|
390
390
|
|
|
391
391
|
#### 1.3.3.5 Integration Points Not Covered
|
|
392
392
|
|
|
393
|
-
The system does not natively integrate with: alternative payment processors beyond Stripe and Freemius, alternative authentication providers beyond Supabase Auth
|
|
393
|
+
The system does not natively integrate with: alternative payment processors beyond Stripe and Freemius, alternative authentication providers beyond Supabase Auth, alternative object-storage providers beyond S3-compatible endpoints (specifically Cloudflare R2 in reference deployments), alternative monorepo orchestrators beyond Nx, or alternative hosting platforms requiring cron-configuration formats other than Vercel's `vercel.json` schema.
|
|
394
394
|
|
|
395
395
|
---
|
|
396
396
|
|
|
@@ -700,9 +700,9 @@ Three menu locations are supported: `HEADER`, `FOOTER`, and `SIDEBAR`, encoded b
|
|
|
700
700
|
|
|
701
701
|
**Description**
|
|
702
702
|
|
|
703
|
-
Authentication is layered over Supabase Auth using `@supabase/ssr` 0.7.0 and `@supabase/supabase-js` 2.77.0. Server actions in `apps/nextblock/app/actions.ts` implement sign-in, sign-up, and forgot-password flows
|
|
703
|
+
Authentication is layered over Supabase Auth using `@supabase/ssr` 0.7.0 and `@supabase/supabase-js` 2.77.0. Server actions in `apps/nextblock/app/actions.ts` implement sign-in, sign-up, and forgot-password flows. The `app/auth/callback/route.ts` route exchanges authorization codes for sessions (used by the email-confirmation and recovery flows) (`supabase.auth.exchangeCodeForSession()`), loads the profile role, and redirects using `resolvePostAuthRedirect()`. Email templates for confirmation, email change, invitation, magic-link, reauthentication, and password recovery reside in `libs/db/src/supabase/templates/`. A `handle_new_user()` trigger function paired with the `on_auth_user_created` trigger on `auth.users` automatically provisions a `profiles` row on registration.
|
|
704
704
|
|
|
705
|
-
**Business Value:** Eliminates the need for adopters to integrate a separate identity provider. **User Benefits:** Multiple sign-in methods (email/password,
|
|
705
|
+
**Business Value:** Eliminates the need for adopters to integrate a separate identity provider. **User Benefits:** Multiple sign-in methods (email/password, magic link) with localized email templates. **Technical Context:** Supabase Auth session cookies are synchronized by the request proxy to Server Components.
|
|
706
706
|
|
|
707
707
|
**Dependencies**
|
|
708
708
|
|
|
@@ -1323,7 +1323,7 @@ This subsection provides the detailed, testable requirements that operationalize
|
|
|
1323
1323
|
| Requirement ID | Description | Priority | Complexity |
|
|
1324
1324
|
|:--|:--|:--|:--|
|
|
1325
1325
|
| F-002-RQ-001 | Supabase Auth session exchange MUST succeed via `app/auth/callback/route.ts` | Must-Have | Medium |
|
|
1326
|
-
| F-002-RQ-002 |
|
|
1326
|
+
| F-002-RQ-002 | *(Removed)* Third-party OAuth sign-in is intentionally not provided — it cannot be configured as part of a one-click deployment | Won't-Have | — |
|
|
1327
1327
|
| F-002-RQ-003 | `handle_new_user()` trigger MUST provision a `profiles` row on every `auth.users` insert | Must-Have | Medium |
|
|
1328
1328
|
| F-003-RQ-001 | First registered user MUST become `ADMIN`; subsequent users MUST become `USER` | Must-Have | Medium |
|
|
1329
1329
|
| F-003-RQ-002 | `/cms` MUST require `WRITER` or `ADMIN`; `/cms/admin`, `/cms/users`, `/cms/settings` MUST require `ADMIN` only | Must-Have | Medium |
|
|
@@ -2135,7 +2135,7 @@ graph TB
|
|
|
2135
2135
|
|
|
2136
2136
|
#### 3.4.1.1 Responsibilities
|
|
2137
2137
|
|
|
2138
|
-
Supabase provides PostgreSQL data storage, Row-Level Security, authentication (F-002), and session cookie management.
|
|
2138
|
+
Supabase provides PostgreSQL data storage, Row-Level Security, authentication (F-002), and session cookie management. Six email templates for the authentication flow (confirmation, email change, invitation, magic-link, reauthentication, password recovery) reside in `libs/db/src/supabase/templates/` and are synchronized with Supabase through `npm run configure:supabase-auth`.
|
|
2139
2139
|
|
|
2140
2140
|
#### 3.4.1.2 Environment Variables
|
|
2141
2141
|
|
|
@@ -2428,7 +2428,7 @@ The Default Technology Stack specified for this project included assumptions tha
|
|
|
2428
2428
|
| **Terraform** IaC | Declarative configs (`vercel.json`, Supabase migrations, `project.json`) | Application-layer declarative configuration suffices given the managed-service stack |
|
|
2429
2429
|
| **GitHub Actions** CI/CD | Vercel Git deploy + Node release scripts | Release cadence and library publishing managed via `tools/scripts/*` |
|
|
2430
2430
|
| **Python / Flask** backend | TypeScript + Next.js 16 route handlers | Monolithic Next.js model enables RSC co-located with API routes |
|
|
2431
|
-
| **Auth0** authentication | Supabase Auth
|
|
2431
|
+
| **Auth0** authentication | Supabase Auth (GoTrue) | Supabase Auth unifies database and identity for RLS-driven authorization (F-003) |
|
|
2432
2432
|
| **MongoDB** database | Supabase PostgreSQL | Relational schema with RLS is better suited to the commerce and content data model |
|
|
2433
2433
|
| **Langchain** AI framework | Not present (structural AI-readiness only) | Per §1.3.3.1, AI runtime features are "coming soon" |
|
|
2434
2434
|
| **React-Native** mobile | Not used — web-only Next.js | Out-of-scope per §1.3.3.5 |
|
|
@@ -4156,7 +4156,7 @@ The Zustand-backed cart (with `persist` middleware) captures items in the browse
|
|
|
4156
4156
|
|
|
4157
4157
|
#### 5.1.3.3 Primary Authoring Flow
|
|
4158
4158
|
|
|
4159
|
-
Authors sign in via Supabase Auth
|
|
4159
|
+
Authors sign in via Supabase Auth (email/password), whose email-confirmation callback is handled at `app/auth/callback/route.ts`. After the role-based redirect from `lib/auth-redirects.ts`, authors enter `/cms/*` surfaces, which use Tiptap-based editors and the in-app `blockRegistry.ts` to compose pages. Published content triggers a Supabase webhook to `/api/revalidate`, which calls `revalidatePath` for `/slug` (pages) or `/article/slug` (posts).
|
|
4160
4160
|
|
|
4161
4161
|
#### 5.1.3.4 Integration, Transformation, and Storage
|
|
4162
4162
|
|
|
@@ -4703,7 +4703,7 @@ The primary error notification path is the Feedback System (F-029), which allows
|
|
|
4703
4703
|
|
|
4704
4704
|
#### 5.4.4.1 Authentication
|
|
4705
4705
|
|
|
4706
|
-
Supabase Auth provides email/password
|
|
4706
|
+
Supabase Auth provides email/password and magic-link sign-in. Sign-in server actions live in `app/actions.ts`; the email-confirmation callback resolves to `app/auth/callback/route.ts`, which exchanges the code for a session and then delegates to `lib/auth-redirects.ts` for the post-auth destination. The redirect resolver validates that any `next` parameter is a safe internal path, preserves `/reset-password`, routes `ADMIN`/`WRITER` to `safePath` or `/cms/dashboard`, sends `USER` without `full_name` to `/profile`, and otherwise falls back to `/`.
|
|
4707
4707
|
|
|
4708
4708
|
#### 5.4.4.2 Authorization Model
|
|
4709
4709
|
|
|
@@ -5656,7 +5656,7 @@ Declared in migration `00000000000001_setup_cms_core.sql`, these tables bootstra
|
|
|
5656
5656
|
| Table | Primary Key | Key Columns / Constraints |
|
|
5657
5657
|
|-------|-------------|----------------------------|
|
|
5658
5658
|
| `site_settings` | `key` (text) | `value jsonb` — flat key/value store for global configuration |
|
|
5659
|
-
| `profiles` | `id uuid` | FK → `auth.users(id) ON DELETE CASCADE`; `role user_role NOT NULL DEFAULT 'USER'`; `full_name`, `avatar_url`, `website`, `
|
|
5659
|
+
| `profiles` | `id uuid` | FK → `auth.users(id) ON DELETE CASCADE`; `role user_role NOT NULL DEFAULT 'USER'`; `full_name`, `avatar_url`, `website`, `phone` |
|
|
5660
5660
|
| `user_addresses` | `id` (identity) | FK → `profiles(id)`; `address_type CHECK IN ('billing','shipping')`; `is_default`, `recipient_name`, `line1/2`, `city`, `state`, `postal_code`, `country_code` |
|
|
5661
5661
|
| `languages` | `id bigint` | `code UNIQUE`, `name`, `is_default`, `is_active DEFAULT true` |
|
|
5662
5662
|
| `media` | `id uuid` | `uploader_id → profiles`; `object_key UNIQUE`; `variants jsonb`; `blur_data_url`; `width`, `height`, `size_bytes`, `file_path`, `folder` |
|
|
@@ -7561,16 +7561,17 @@ flowchart TB
|
|
|
7561
7561
|
|
|
7562
7562
|
#### 6.4.2.1 Identity Management
|
|
7563
7563
|
|
|
7564
|
-
The identity provider is **Supabase Auth (GoTrue)**, consumed through the `@supabase/ssr` adapter layer.
|
|
7564
|
+
The identity provider is **Supabase Auth (GoTrue)**, consumed through the `@supabase/ssr` adapter layer. Three distinct authentication surfaces are exposed to end users:
|
|
7565
7565
|
|
|
7566
7566
|
| Authentication Method | Entry Point | Implementation |
|
|
7567
7567
|
|-----------------------|-------------|----------------|
|
|
7568
7568
|
| Email/Password | `signInAction` in `app/actions.ts` | `supabase.auth.signInWithPassword` |
|
|
7569
7569
|
| Account Registration | `signUpAction` in `app/actions.ts` | `supabase.auth.signUp` with email confirmation |
|
|
7570
7570
|
| Password Recovery | `forgotPasswordAction` in `app/actions.ts` | `supabase.auth.resetPasswordForEmail` (OTP) |
|
|
7571
|
-
| GitHub OAuth | `components/GitHubLoginButton.tsx` | `supabase.auth.signInWithOAuth({ provider: 'github' })` |
|
|
7572
7571
|
|
|
7573
|
-
|
|
7572
|
+
> **No third-party OAuth providers.** GitHub OAuth sign-in and account-linking were removed: they cannot be provisioned as part of a one-click deployment (each install needs its own GitHub OAuth app, client secret, and Supabase's manual-linking toggle, none of which can ship in a migration). The unrelated self-update "Connect GitHub" flow (`lib/updates/*`) is not an end-user auth surface and remains.
|
|
7573
|
+
|
|
7574
|
+
The auth callback route handler at `apps/nextblock/app/auth/callback/route.ts` receives a short-lived authorization code on the query string (used by the email-confirmation and recovery flows), invokes `supabase.auth.exchangeCodeForSession(code)` to convert the code to a session, fetches the user profile via `getProfileWithRoleServerSide(user.id)`, and delegates redirection logic to `resolvePostAuthRedirect` in `apps/nextblock/lib/auth-redirects.ts`. On any exchange failure, the handler redirects to `initialRedirectTo || '/'`.
|
|
7574
7575
|
|
|
7575
7576
|
Six transactional email templates reside in `libs/db/src/supabase/templates/` — covering confirmation, email change, invitation, magic-link, reauthentication, and password recovery — and are synchronized with the Supabase project via `npm run configure:supabase-auth`.
|
|
7576
7577
|
|
|
@@ -7652,7 +7653,7 @@ The following sequence diagram depicts the full authentication flow from credent
|
|
|
7652
7653
|
sequenceDiagram
|
|
7653
7654
|
actor User
|
|
7654
7655
|
participant Browser
|
|
7655
|
-
participant AuthPage as /sign-in
|
|
7656
|
+
participant AuthPage as /sign-in
|
|
7656
7657
|
participant SbAuth as Supabase Auth (GoTrue)
|
|
7657
7658
|
participant Callback as /auth/callback/route.ts
|
|
7658
7659
|
participant Resolver as lib/auth-redirects.ts
|
|
@@ -7660,12 +7661,12 @@ sequenceDiagram
|
|
|
7660
7661
|
participant Profiles as profiles table
|
|
7661
7662
|
participant CMS as /cms/*
|
|
7662
7663
|
|
|
7663
|
-
User->>Browser: Submit credentials
|
|
7664
|
-
Browser->>AuthPage: POST (email+password)
|
|
7665
|
-
AuthPage->>SbAuth: signInWithPassword
|
|
7666
|
-
SbAuth-->>Browser:
|
|
7664
|
+
User->>Browser: Submit credentials
|
|
7665
|
+
Browser->>AuthPage: POST (email+password)
|
|
7666
|
+
AuthPage->>SbAuth: signInWithPassword
|
|
7667
|
+
SbAuth-->>Browser: Session cookies
|
|
7667
7668
|
|
|
7668
|
-
alt
|
|
7669
|
+
alt Email confirmation / recovery (code exchange)
|
|
7669
7670
|
Browser->>Callback: GET /auth/callback?code=...
|
|
7670
7671
|
Callback->>SbAuth: exchangeCodeForSession(code)
|
|
7671
7672
|
SbAuth-->>Callback: Set-Cookie (HttpOnly, Secure)
|
|
@@ -7720,7 +7721,7 @@ Authorization is driven by the `user_role` enum declared in migration `000000000
|
|
|
7720
7721
|
| `USER` | Default for new signups | Customer profile, addresses, own orders |
|
|
7721
7722
|
| `service_role` | Supabase service-role key | Webhooks, cron, admin server actions — bypasses RLS |
|
|
7722
7723
|
|
|
7723
|
-
Role assignment at bootstrap is governed by the `handle_new_user()` SECURITY DEFINER trigger function bound to `auth.users` via `on_auth_user_created AFTER INSERT ON auth.users FOR EACH ROW`. The trigger acquires a `FOR UPDATE` lock on the `site_settings` row where `setting_key = 'is_admin_created'`, assigns `role='ADMIN'` if the latch is false (and sets the latch), otherwise assigns `role='USER'`,
|
|
7724
|
+
Role assignment at bootstrap is governed by the `handle_new_user()` SECURITY DEFINER trigger function bound to `auth.users` via `on_auth_user_created AFTER INSERT ON auth.users FOR EACH ROW`. The trigger acquires a `FOR UPDATE` lock on the `site_settings` row where `setting_key = 'is_admin_created'`, assigns `role='ADMIN'` if the latch is false (and sets the latch), otherwise assigns `role='USER'`, and always creates a `profiles` row. The `FOR UPDATE` lock guarantees race-free first-admin election even under concurrent signup attempts.
|
|
7724
7725
|
|
|
7725
7726
|
#### 6.4.3.2 Permission Management and SECURITY DEFINER Helpers
|
|
7726
7727
|
|
|
@@ -7908,7 +7909,7 @@ The repository does not implement explicit PII masking transforms. The following
|
|
|
7908
7909
|
| Error message sanitization | All error responses | Never contains JWT, service role key, or DB connection strings |
|
|
7909
7910
|
| Admin user list | `/cms/users` | Email addresses displayed (no masking) — audience is ADMIN only |
|
|
7910
7911
|
|
|
7911
|
-
The CMS admin user-list page uses the service-role client via `supabaseAdmin.auth.admin.listUsers` to enumerate users; since the audience of that surface is already `ADMIN`-gated, no masking transform is applied. PII in `profiles` (`full_name`, `avatar_url`, `phone
|
|
7912
|
+
The CMS admin user-list page uses the service-role client via `supabaseAdmin.auth.admin.listUsers` to enumerate users; since the audience of that surface is already `ADMIN`-gated, no masking transform is applied. PII in `profiles` (`full_name`, `avatar_url`, `phone`) is protected by RLS self-scoping rather than cryptographic masking.
|
|
7912
7913
|
|
|
7913
7914
|
#### 6.4.4.4 Secure Communication
|
|
7914
7915
|
|
|
@@ -8202,7 +8203,6 @@ For details beyond the scope of this section, consult:
|
|
|
8202
8203
|
- `apps/nextblock/app/(auth-pages)/post-sign-in/page.tsx` — 27-line post-auth routing page
|
|
8203
8204
|
- `apps/nextblock/app/unauthorized/page.tsx` — 26-line unauthorized display
|
|
8204
8205
|
- `apps/nextblock/context/AuthContext.tsx` — Client auth state provider
|
|
8205
|
-
- `apps/nextblock/components/GitHubLoginButton.tsx` — 37-line OAuth initiation
|
|
8206
8206
|
|
|
8207
8207
|
#### CMS Guards and Admin Self-Protection
|
|
8208
8208
|
|
|
@@ -9691,7 +9691,7 @@ Four distinct persona classes consume the UI, with role-based affordances enforc
|
|
|
9691
9691
|
The UI surface supports six top-level capability families, each rooted in a dedicated route group:
|
|
9692
9692
|
|
|
9693
9693
|
1. **Public Content Delivery (F-001)** — locale-aware marketing, article, and product-detail rendering with SEO metadata, `robots.txt`, and `sitemap.xml`.
|
|
9694
|
-
2. **Authentication & Account (F-002)** — email/password,
|
|
9694
|
+
2. **Authentication & Account (F-002)** — email/password, magic-link, password reset, profile completion.
|
|
9695
9695
|
3. **CMS Authoring (F-004, F-005, F-006, F-007, F-008, F-009)** — block-based page building, Tiptap rich text, media library, translations, revision history, navigation management.
|
|
9696
9696
|
4. **Commerce (F-013 through F-021)** — catalog browsing, variant selection, cart, checkout, invoicing, customer order history.
|
|
9697
9697
|
5. **Administration (F-003, F-030)** — user management, package activation, site settings, shipping/tax configuration.
|
|
@@ -9852,8 +9852,8 @@ The auth forms consume a typed message union defined in `apps/nextblock/componen
|
|
|
9852
9852
|
|
|
9853
9853
|
| Path | File | Purpose |
|
|
9854
9854
|
|:--|:--|:--|
|
|
9855
|
-
| `/sign-in` | `app/(auth-pages)/sign-in/page.tsx` | Email/password
|
|
9856
|
-
| `/sign-up` | `app/(auth-pages)/sign-up/page.tsx` | Registration (email
|
|
9855
|
+
| `/sign-in` | `app/(auth-pages)/sign-in/page.tsx` | Email/password, forgot-password link, sandbox credentials alert |
|
|
9856
|
+
| `/sign-up` | `app/(auth-pages)/sign-up/page.tsx` | Registration (email) with success confirmation view |
|
|
9857
9857
|
| `/forgot-password` | `app/(auth-pages)/forgot-password/page.tsx` | Password reset request form |
|
|
9858
9858
|
| `/post-sign-in` | `app/(auth-pages)/post-sign-in/page.tsx` | Server routing endpoint (non-visual redirector) |
|
|
9859
9859
|
| `/auth/callback` | `app/auth/callback/route.ts` | OAuth authorization-code exchange handler |
|
|
@@ -10046,10 +10046,9 @@ The component consumes `useTheme` from `next-themes`, uses a mounted-state guard
|
|
|
10046
10046
|
|
|
10047
10047
|
| Interaction | Implementation |
|
|
10048
10048
|
|:--|:--|
|
|
10049
|
-
| Sign-In Form | Email/password + forgot-password link + `
|
|
10049
|
+
| Sign-In Form | Email/password + forgot-password link + `SandboxCredentialsAlert` when `NEXT_PUBLIC_IS_SANDBOX === 'true'`. Max-width `160` (mx-auto). Hidden `redirect` field preserved for post-sign-in routing |
|
|
10050
10050
|
| Sign-Up Form | Shared layout with sign-in. Success view rendered when URL contains success flag: confirmation badge (`rounded-full bg-primary/10 text-primary`), `CheckCircle2` icon, email-check instructions with `Mail` icon, "Back to sign in" / "Use different email" actions |
|
|
10051
10051
|
| Header Auth (`header-auth.tsx`) | Missing-env warning badge + disabled buttons when env vars absent; avatar dropdown (`h-8 w-8 rounded-full`) with profile/dashboard/logout when authenticated; sign-in/sign-up buttons for guests |
|
|
10052
|
-
| GitHub OAuth (`GitHubLoginButton.tsx`) | Outline variant, full-width button with embedded GitHub SVG; invokes `supabase.auth.signInWithOAuth({ provider: 'github' })` with callback URL |
|
|
10053
10052
|
|
|
10054
10053
|
### 7.7.6 Commerce UI Interactions
|
|
10055
10054
|
|
|
@@ -10275,7 +10274,7 @@ Server-resolved locale (from `X-User-Locale` header) is bridged to client via `T
|
|
|
10275
10274
|
|
|
10276
10275
|
#### Authentication Screens
|
|
10277
10276
|
|
|
10278
|
-
- `apps/nextblock/app/(auth-pages)/sign-in/page.tsx` —
|
|
10277
|
+
- `apps/nextblock/app/(auth-pages)/sign-in/page.tsx` — Email/password sign-in
|
|
10279
10278
|
- `apps/nextblock/app/(auth-pages)/sign-up/page.tsx` — Sign-up with success state
|
|
10280
10279
|
- `apps/nextblock/app/(auth-pages)/forgot-password/page.tsx` — Password reset
|
|
10281
10280
|
- `apps/nextblock/app/(auth-pages)/post-sign-in/page.tsx` — Server-routing endpoint
|
|
@@ -10298,7 +10297,6 @@ Server-resolved locale (from `X-User-Locale` header) is bridged to client via `T
|
|
|
10298
10297
|
- `apps/nextblock/components/ResponsiveNav.tsx` — Hierarchical navigation
|
|
10299
10298
|
- `apps/nextblock/components/theme-switcher.tsx` — Four-theme dropdown
|
|
10300
10299
|
- `apps/nextblock/components/header-auth.tsx` — Authenticated vs guest auth UI
|
|
10301
|
-
- `apps/nextblock/components/GitHubLoginButton.tsx` — OAuth trigger button
|
|
10302
10300
|
- `apps/nextblock/components/form-message.tsx` — Typed auth message renderer
|
|
10303
10301
|
|
|
10304
10302
|
#### Client Context Providers
|
|
@@ -10627,7 +10625,7 @@ Three distinct cloud providers compose the production footprint. The rationale f
|
|
|
10627
10625
|
| Provider | Role | Selection Rationale |
|
|
10628
10626
|
|:--|:--|:--|
|
|
10629
10627
|
| Vercel | Compute + Edge + Cron + RUM | Zero-configuration Next.js 16 hosting; built-in image optimization; native App Router support; no container orchestration overhead; cron scheduling integrated with function lifecycle |
|
|
10630
|
-
| Supabase | PostgreSQL + Auth + Storage metadata | Managed PostgreSQL 17 with built-in RLS; GoTrue auth service;
|
|
10628
|
+
| Supabase | PostgreSQL + Auth + Storage metadata | Managed PostgreSQL 17 with built-in RLS; GoTrue auth service; SQL migration CLI; PITR included; generous free tier for open-core distribution |
|
|
10631
10629
|
| Cloudflare R2 | S3-compatible object storage | Zero egress fees (superior to AWS S3 for media-heavy workloads); S3-compatible API usable via `@aws-sdk/client-s3 ^3.920.0`; global edge presence |
|
|
10632
10630
|
|
|
10633
10631
|
**Documented deviations from the Default Technology Stack** (per §3.7.1):
|
|
@@ -10639,7 +10637,7 @@ Three distinct cloud providers compose the production footprint. The rationale f
|
|
|
10639
10637
|
| Terraform | Declarative config across `vercel.json`, migrations, `config.toml`, `.env.exemple`, `nx.json` | No multi-service provisioning to orchestrate |
|
|
10640
10638
|
| GitHub Actions | Vercel Git integration + Node release scripts in `tools/scripts/` | No CI test suite to gate; publication handled imperatively |
|
|
10641
10639
|
| Python / Flask | TypeScript + Next.js route handlers | Unified stack across client + server |
|
|
10642
|
-
| Auth0 | Supabase Auth (GoTrue)
|
|
10640
|
+
| Auth0 | Supabase Auth (GoTrue) | Integrated with RLS at the database layer |
|
|
10643
10641
|
| MongoDB | Supabase PostgreSQL | Relational data model + RLS + SECURITY DEFINER helpers |
|
|
10644
10642
|
|
|
10645
10643
|
### 8.3.2 Core Services and Versions
|
|
@@ -10663,7 +10661,7 @@ Three distinct cloud providers compose the production footprint. The rationale f
|
|
|
10663
10661
|
| PostgreSQL | `postgres` | `^3.8` (inventory dual-path fallback) | Direct SQL when RPC unavailable |
|
|
10664
10662
|
| SSR client | `@supabase/ssr` | `^0.7.0` | Server-side cookie-based session |
|
|
10665
10663
|
| Browser client | `@supabase/supabase-js` | `^2.77.0` | Client components + editor |
|
|
10666
|
-
| Auth (GoTrue) | via `@supabase/ssr` | bundled | Email/password,
|
|
10664
|
+
| Auth (GoTrue) | via `@supabase/ssr` | bundled | Email/password, password reset |
|
|
10667
10665
|
| Realtime | bundled (enabled in `config.toml`) | bundled | WebSocket subscriptions |
|
|
10668
10666
|
| CLI | `supabase` | invoked via `npx supabase` | Migrations, link, db push, config push |
|
|
10669
10667
|
|
|
@@ -155,12 +155,12 @@ const RELATION_TARGETS: readonly CustomBlockRelationTarget[] = [
|
|
|
155
155
|
valueType: 'string',
|
|
156
156
|
},
|
|
157
157
|
{
|
|
158
|
-
descriptionColumns: ['
|
|
158
|
+
descriptionColumns: ['website'],
|
|
159
159
|
displayColumn: 'full_name',
|
|
160
160
|
label: 'Profiles',
|
|
161
161
|
orderBy: 'full_name',
|
|
162
|
-
searchableColumns: ['full_name', '
|
|
163
|
-
selectColumns: ['id', 'full_name', 'avatar_url', '
|
|
162
|
+
searchableColumns: ['full_name', 'website'],
|
|
163
|
+
selectColumns: ['id', 'full_name', 'avatar_url', 'website', 'role'],
|
|
164
164
|
table: 'profiles',
|
|
165
165
|
valueColumn: 'id',
|
|
166
166
|
valueType: 'string',
|