riverbankcms 0.21.0 → 0.22.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.
@@ -178,7 +178,8 @@ When portal auth is enabled, `riverbankcms init` generates these reserved routes
178
178
  | `/portal/tickets/[registrationId]` | `createPortalTicketPage` | `portalPageTemplates` |
179
179
  | `/portal/digital-products/[entitlementId]` | `createPortalDigitalProductPage` | `portalPageTemplates` |
180
180
  | `/portal/digital-products/[entitlementId]/files/[assetId]` | `createPortalDigitalProductFilePage` | `portalPageTemplates` |
181
- | `/api/portal/callback` (GET) | `handlePortalCallback` from `@riverbankcms/sdk/portal` | `portalCallbackRouteTemplate` |
181
+ | `/redeem` | `createRedeemPage` | `portalPageTemplates` |
182
+ | `/api/portal/callback` (GET + POST) | `handlePortalCallback` from `@riverbankcms/sdk/portal` | `portalCallbackRouteTemplate` |
182
183
  | `/api/portal/logout` (POST) | `handlePortalLogout` | `portalLogoutRouteTemplate` |
183
184
 
184
185
  Existing sites should add these files after upgrading the SDK. Import
@@ -193,3 +194,18 @@ For a custom host, `CustomerPortal` from `@riverbankcms/sdk/portal/client` takes
193
194
  (defaults `/api/portal/callback`, `/api/portal/logout`, `/book`). Wrap it in the
194
195
  site's `ThemeScope`. This is a reserved route component, not a CMS block.
195
196
  `@riverbankcms/sdk/portal` remains the server helper entry.
197
+
198
+
199
+ Gift delivery needs `/redeem`, the portal routes and the callback POST handler
200
+ in place before the site sends gifts. Upgrade the SDK and add the scaffolded
201
+ routes together. The redeem helper accepts the same theme options as the portal.
202
+ Add `Referrer-Policy: no-referrer` to `/redeem` in your Next config (the scaffold
203
+ includes it); this protects emailed gift tokens in outbound referrers.
204
+
205
+ For a custom host, `RedeemGiftCard` from `@riverbankcms/sdk/gifting/client` takes
206
+ `siteId`, `apiBaseUrl`, `siteTitle`, `publicContactEmail` (nullable), optional
207
+ `token` and `code`, and optional `callbackPath`, `portalPath`, `homePath` (defaults
208
+ `/api/portal/callback`, `/portal`, `/`). Its `onSignedIn` callback refreshes host
209
+ chrome after sign-in; the Next helper supplies that callback. Wrap the shared
210
+ component in the site's `ThemeScope`. The callback POST expects JSON
211
+ `{ portalCode }` from the same origin and returns JSON without redirecting.