riverbankcms 0.36.0 → 0.38.0

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.
@@ -174,25 +174,25 @@ When portal auth is enabled, `riverbankcms init` generates these reserved routes
174
174
 
175
175
  | Route | SDK helper | Scaffold template |
176
176
  | --- | --- | --- |
177
- | `/portal` | `createPortalPage` from `@riverbankcms/sdk/next` | `portalPageTemplates` |
178
- | `/portal/continue` | `createPortalContinuePage` | `portalPageTemplates` |
179
- | `/portal/tickets/[registrationId]` | `createPortalTicketPage` | `portalPageTemplates` |
180
- | `/portal/digital-products/[entitlementId]` | `createPortalDigitalProductPage` | `portalPageTemplates` |
181
- | `/portal/digital-products/[entitlementId]/files/[assetId]` | `createPortalDigitalProductFilePage` | `portalPageTemplates` |
177
+ | `/portal/[[...path]]` (every portal page, including Continue, tickets and downloads) | `createPortalPage` from `@riverbankcms/sdk/next` | `portalPageTemplates` |
182
178
  | `/redeem` | `createRedeemPage` | `portalPageTemplates` |
183
179
  | `/api/portal/callback` (GET + POST) | `handlePortalCallback` from `@riverbankcms/sdk/portal` | `portalCallbackRouteTemplate` |
184
180
  | `/api/portal/logout` (POST) | `handlePortalLogout` | `portalLogoutRouteTemplate` |
185
181
 
186
- Existing sites should add these files after upgrading the SDK. Import
182
+ Existing sites should add these files after upgrading the SDK. A site from before the catch-all
183
+ replaces its `app/portal/page.tsx`, `portal/continue`, `portal/tickets` and `portal/digital-products`
184
+ pages with the one `app/portal/[[...path]]/page.tsx`; old email links keep working through it. The page
185
+ exports `generateMetadata = generatePortalPageMetadata` so each portal page gets its own title. Import
187
186
  `@riverbankcms/sdk/styles.css` globally. The page helpers provide the site theme
188
187
  scope automatically; sites with `themeSource: 'local'` pass the same `theme`,
189
188
  `themes`/`themeSwitch`, or `getTheme` options used by their catch-all. A custom
190
189
  resolver receives `content.type === 'portal'` and `content.site` on these routes. The callback and logout routes own the HTTP-only cookie.
191
190
  The file route authenticates before redirecting to a signed download URL.
192
191
 
193
- For a custom host, `CustomerPortal` from `@riverbankcms/sdk/portal/client` takes
194
- `siteId`, `apiBaseUrl`, `portalToken` (nullable), `demoEmailSuppressed`, plus optional `logoutPath` and `bookPath`
195
- (defaults `/api/portal/logout`, `/book`). Sign-in always goes through `/api/portal/callback`. Wrap it in the
192
+ For a custom host, use `renderPortalRoute` from `@riverbankcms/sdk/next` with a context from
193
+ `portalHostContext`: it draws Continue, tickets and downloads itself and hands every other page's props
194
+ (the parsed `initialLocation` included) to your `CustomerPortal` from `@riverbankcms/sdk/portal/client`,
195
+ which also takes optional `logoutPath` and `bookPath` (defaults `/api/portal/logout`, `/book`). Sign-in always goes through `/api/portal/callback`. Wrap it in the
196
196
  site's `ThemeScope`. This is a reserved route component, not a CMS block.
197
197
  `@riverbankcms/sdk/portal` remains the server helper entry.
198
198
 
@@ -205,7 +205,7 @@ includes it); this protects emailed gift tokens in outbound referrers.
205
205
 
206
206
  For a custom host, `RedeemGiftCard` from `@riverbankcms/sdk/gifting/client` takes
207
207
  `siteId`, `apiBaseUrl`, `siteTitle`, `publicContactEmail` (nullable), optional
208
- `token` and `code`, and optional `portalPath`, `homePath` (defaults `/portal`, `/`). Its `onSignedIn` callback refreshes host
208
+ `token` and `code`, and optional `homePath` (default `/`). Its `onSignedIn` callback refreshes host
209
209
  chrome after sign-in; the Next helper supplies that callback. Wrap the shared
210
210
  component in the site's `ThemeScope`. The callback POST expects JSON
211
211
  `{ portalCode }` from the same origin and returns JSON without redirecting.