@cimplify/cli 0.7.8 → 0.7.9

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.
Files changed (28) hide show
  1. package/dist/{add-BMHJY65N.mjs → add-VVHQBW36.mjs} +1 -1
  2. package/dist/{chunk-WO2KN3QD.mjs → chunk-STSY4IG3.mjs} +1 -1
  3. package/dist/{chunk-7ULQCWYD.mjs → chunk-UE4YMNDU.mjs} +380 -12
  4. package/dist/{chunk-LH7Y27BQ.mjs → chunk-YSUPIC6B.mjs} +1 -1
  5. package/dist/dispatcher.mjs +9 -9
  6. package/dist/{doctor-U7QRYEFG.mjs → doctor-TCI6VXGG.mjs} +2 -2
  7. package/dist/{explain-ZPBYGQWC.mjs → explain-VCSTQ54F.mjs} +1 -1
  8. package/dist/{introspect-JFJOCF5M.mjs → introspect-GQVDSF7A.mjs} +2 -2
  9. package/dist/{list-LOKEBW5S.mjs → list-IYNO5OV6.mjs} +1 -1
  10. package/dist/{update-EJGLLHRW.mjs → update-ORQGRL6E.mjs} +1 -1
  11. package/package.json +1 -1
  12. package/templates/manifest.json +26 -26
  13. package/templates/storefront-auto/components/auth-error-toast.tsx +46 -0
  14. package/templates/storefront-auto/components/providers.tsx +5 -1
  15. package/templates/storefront-bakery/components/auth-error-toast.tsx +46 -0
  16. package/templates/storefront-bakery/components/providers.tsx +5 -1
  17. package/templates/storefront-fashion/components/auth-error-toast.tsx +46 -0
  18. package/templates/storefront-fashion/components/providers.tsx +5 -1
  19. package/templates/storefront-grocery/components/auth-error-toast.tsx +46 -0
  20. package/templates/storefront-grocery/components/providers.tsx +5 -1
  21. package/templates/storefront-pharmacy/components/auth-error-toast.tsx +46 -0
  22. package/templates/storefront-pharmacy/components/providers.tsx +5 -1
  23. package/templates/storefront-restaurant/components/auth-error-toast.tsx +46 -0
  24. package/templates/storefront-restaurant/components/providers.tsx +5 -1
  25. package/templates/storefront-retail/components/auth-error-toast.tsx +46 -0
  26. package/templates/storefront-retail/components/providers.tsx +5 -1
  27. package/templates/storefront-services/components/auth-error-toast.tsx +46 -0
  28. package/templates/storefront-services/components/providers.tsx +5 -1
@@ -2,7 +2,7 @@
2
2
  // package.json
3
3
  var package_default = {
4
4
  name: "@cimplify/cli",
5
- version: "0.7.8",
5
+ version: "0.7.9",
6
6
  description: "Cimplify CLI \u2014 deploy, manage env vars, link projects, and scaffold storefronts",
7
7
  keywords: [
8
8
  "cimplify",
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import { TEMPLATES } from './chunk-7ULQCWYD.mjs';
3
- import { package_default } from './chunk-LH7Y27BQ.mjs';
2
+ import { TEMPLATES } from './chunk-UE4YMNDU.mjs';
3
+ import { package_default } from './chunk-YSUPIC6B.mjs';
4
4
 
5
5
  // src/dispatcher.ts
6
6
  var VERSION = package_default.version ?? "unknown";
@@ -138,16 +138,16 @@ var COMMANDS = {
138
138
  logs: () => import('./logs-YNN2PQ24.mjs'),
139
139
  status: () => import('./status-JSYXM5RT.mjs'),
140
140
  dev: () => import('./dev-ONW2S77K.mjs'),
141
- introspect: () => import('./introspect-JFJOCF5M.mjs'),
141
+ introspect: () => import('./introspect-GQVDSF7A.mjs'),
142
142
  inspect: () => import('./inspect-CGYX4DDF.mjs'),
143
- doctor: () => import('./doctor-U7QRYEFG.mjs'),
144
- explain: () => import('./explain-ZPBYGQWC.mjs'),
143
+ doctor: () => import('./doctor-TCI6VXGG.mjs'),
144
+ explain: () => import('./explain-VCSTQ54F.mjs'),
145
145
  assets: () => import('./assets-74SK63TR.mjs'),
146
146
  repo: () => import('./repo-KNQMSPVV.mjs'),
147
- list: () => import('./list-LOKEBW5S.mjs'),
148
- add: () => import('./add-BMHJY65N.mjs'),
149
- update: () => import('./update-EJGLLHRW.mjs'),
150
- upgrade: () => import('./update-EJGLLHRW.mjs'),
147
+ list: () => import('./list-IYNO5OV6.mjs'),
148
+ add: () => import('./add-VVHQBW36.mjs'),
149
+ update: () => import('./update-ORQGRL6E.mjs'),
150
+ upgrade: () => import('./update-ORQGRL6E.mjs'),
151
151
  "auth-step-up": () => import('./auth-step-up-BIUYQJP6.mjs')
152
152
  };
153
153
  var COMMAND_PREFIXES = {
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
- import { gatherIntrospection } from './chunk-WO2KN3QD.mjs';
2
+ import { gatherIntrospection } from './chunk-STSY4IG3.mjs';
3
3
  import './chunk-K5464A3L.mjs';
4
4
  import './chunk-DBZ3UOQ2.mjs';
5
- import './chunk-LH7Y27BQ.mjs';
5
+ import './chunk-YSUPIC6B.mjs';
6
6
  import { parseArgs, flagBool } from './chunk-C4M3DXKC.mjs';
7
7
  import { ApiClient } from './chunk-MAOO6ZZ5.mjs';
8
8
  import { readAuthOrNull } from './chunk-UBAI443T.mjs';
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { package_default } from './chunk-LH7Y27BQ.mjs';
2
+ import { package_default } from './chunk-YSUPIC6B.mjs';
3
3
  import { parseArgs } from './chunk-C4M3DXKC.mjs';
4
4
  import { bold, dim, info, result, CliError, CLI_ERROR_CODE } from './chunk-E2T2SBP5.mjs';
5
5
 
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
- export { run as default, extractMockSeed, gatherIntrospection, renderIntrospection } from './chunk-WO2KN3QD.mjs';
2
+ export { run as default, extractMockSeed, gatherIntrospection, renderIntrospection } from './chunk-STSY4IG3.mjs';
3
3
  import './chunk-K5464A3L.mjs';
4
4
  import './chunk-DBZ3UOQ2.mjs';
5
- import './chunk-LH7Y27BQ.mjs';
5
+ import './chunk-YSUPIC6B.mjs';
6
6
  import './chunk-C4M3DXKC.mjs';
7
7
  import './chunk-UBAI443T.mjs';
8
8
  import './chunk-E2T2SBP5.mjs';
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { REGISTRY_INDEX } from './chunk-7ULQCWYD.mjs';
2
+ import { REGISTRY_INDEX } from './chunk-UE4YMNDU.mjs';
3
3
  import { parseArgs, flagBool } from './chunk-C4M3DXKC.mjs';
4
4
  import { CliError, CLI_ERROR_CODE, info, bold, dim, green, result } from './chunk-E2T2SBP5.mjs';
5
5
 
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { package_default } from './chunk-LH7Y27BQ.mjs';
2
+ import { package_default } from './chunk-YSUPIC6B.mjs';
3
3
  import { promptYesNo } from './chunk-ITAFAORS.mjs';
4
4
  import { parseArgs, flagBool, flagString } from './chunk-C4M3DXKC.mjs';
5
5
  import { success, bold, info, dim, result, failure, CliError, CLI_ERROR_CODE, step, isJsonMode } from './chunk-E2T2SBP5.mjs';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cimplify/cli",
3
- "version": "0.7.8",
3
+ "version": "0.7.9",
4
4
  "description": "Cimplify CLI — deploy, manage env vars, link projects, and scaffold storefronts",
5
5
  "keywords": [
6
6
  "cimplify",
@@ -1,6 +1,6 @@
1
1
  {
2
- "cliVersion": "0.7.8",
3
- "generatedAt": "2026-05-29T18:52:46.276Z",
2
+ "cliVersion": "0.7.9",
3
+ "generatedAt": "2026-05-30T06:25:45.125Z",
4
4
  "templates": [
5
5
  {
6
6
  "id": "bakery",
@@ -18,9 +18,9 @@
18
18
  "seedName": "default",
19
19
  "seedBusinessId": "bus_default_akua_bakery"
20
20
  },
21
- "objectKey": "templates/bakery-v0.7.8.tar.gz",
22
- "sha256": "703cfa58d00bdfcb7efabea4bf38970425a924815a96670b3e034cc89cea4e01",
23
- "sizeBytes": 77159
21
+ "objectKey": "templates/bakery-v0.7.9.tar.gz",
22
+ "sha256": "b82c6c4167db7a2e16d238441931eba02cf3f3bf78959df7ad5e7610a2c9b24d",
23
+ "sizeBytes": 77900
24
24
  },
25
25
  {
26
26
  "id": "restaurant",
@@ -38,9 +38,9 @@
38
38
  "seedName": "restaurant",
39
39
  "seedBusinessId": "bus_mamas_kitchen"
40
40
  },
41
- "objectKey": "templates/restaurant-v0.7.8.tar.gz",
42
- "sha256": "dfb73ea0823b51599fd992a64e91610b8c267ebb4ddc41c582b8005066713de6",
43
- "sizeBytes": 144037
41
+ "objectKey": "templates/restaurant-v0.7.9.tar.gz",
42
+ "sha256": "5258a2189d1252068ec028ad3308dafe0cd4cf4f0a38587955e6c0b523690229",
43
+ "sizeBytes": 144756
44
44
  },
45
45
  {
46
46
  "id": "retail",
@@ -58,9 +58,9 @@
58
58
  "seedName": "retail",
59
59
  "seedBusinessId": "bus_currents_electronics"
60
60
  },
61
- "objectKey": "templates/retail-v0.7.8.tar.gz",
62
- "sha256": "187e2153cf0dd04b47620ce2a3a62f1075296fc03013ae6db65bcae98fd1b4c0",
63
- "sizeBytes": 154591
61
+ "objectKey": "templates/retail-v0.7.9.tar.gz",
62
+ "sha256": "f9d7b06f11d78101186f5a54931fa5f5493dd61e18d1edfd8d3c190cc0ac9c12",
63
+ "sizeBytes": 155330
64
64
  },
65
65
  {
66
66
  "id": "services",
@@ -78,9 +78,9 @@
78
78
  "seedName": "services",
79
79
  "seedBusinessId": "bus_serene_spa"
80
80
  },
81
- "objectKey": "templates/services-v0.7.8.tar.gz",
82
- "sha256": "a7b7e88e72610cc1b3bc3f5132dd3fbe4bfe0ef97150876e8a34b4d45205b3cb",
83
- "sizeBytes": 76843
81
+ "objectKey": "templates/services-v0.7.9.tar.gz",
82
+ "sha256": "cf86eb081ecd8a79ce3cc9a4f0b267dc08af5936a88679e9815db48dd759265f",
83
+ "sizeBytes": 77555
84
84
  },
85
85
  {
86
86
  "id": "grocery",
@@ -98,9 +98,9 @@
98
98
  "seedName": "grocery",
99
99
  "seedBusinessId": "bus_freshmart"
100
100
  },
101
- "objectKey": "templates/grocery-v0.7.8.tar.gz",
102
- "sha256": "c8dca986c5d2291266886115247e2172c92ea3d0256bb3475cdd66141a5f0fa3",
103
- "sizeBytes": 74319
101
+ "objectKey": "templates/grocery-v0.7.9.tar.gz",
102
+ "sha256": "14d60546272a849cbed181ac5fd01ffecc1dc857615140a6a43c6e04133944f5",
103
+ "sizeBytes": 75037
104
104
  },
105
105
  {
106
106
  "id": "fashion",
@@ -118,9 +118,9 @@
118
118
  "seedName": "fashion",
119
119
  "seedBusinessId": "bus_studio_frx"
120
120
  },
121
- "objectKey": "templates/fashion-v0.7.8.tar.gz",
122
- "sha256": "b4b1d5178bee794b6deeda388b9d28a6fadf10950e312dae8f10b4f6f735c1ba",
123
- "sizeBytes": 162319
121
+ "objectKey": "templates/fashion-v0.7.9.tar.gz",
122
+ "sha256": "9950e7b2d6d5c5814d989c4050c4533ba8b46d887ae73bff7749b7b376b87213",
123
+ "sizeBytes": 163095
124
124
  },
125
125
  {
126
126
  "id": "pharmacy",
@@ -138,9 +138,9 @@
138
138
  "seedName": "pharmacy",
139
139
  "seedBusinessId": "bus_wellspring_pharmacy"
140
140
  },
141
- "objectKey": "templates/pharmacy-v0.7.8.tar.gz",
142
- "sha256": "e9e248e3d90c9f7da61a08243f9152b0ea25bb22beb591e9eccf8f6e902dcfbd",
143
- "sizeBytes": 158835
141
+ "objectKey": "templates/pharmacy-v0.7.9.tar.gz",
142
+ "sha256": "753b7413abde2597d534e4d1598ca604e51c209931f89ef73e7acd0da45d7b23",
143
+ "sizeBytes": 159598
144
144
  },
145
145
  {
146
146
  "id": "auto",
@@ -158,9 +158,9 @@
158
158
  "seedName": "auto",
159
159
  "seedBusinessId": "bus_driveline_auto"
160
160
  },
161
- "objectKey": "templates/auto-v0.7.8.tar.gz",
162
- "sha256": "4215739fa1e548f0648122bb73e859e76527512184f1a47e024d67462a78b1be",
163
- "sizeBytes": 209176617
161
+ "objectKey": "templates/auto-v0.7.9.tar.gz",
162
+ "sha256": "28ae007267cd96793f553d77447d355dd6e10f6ea3afbe7173d41aa4e0b1f303",
163
+ "sizeBytes": 191829916
164
164
  }
165
165
  ]
166
166
  }
@@ -0,0 +1,46 @@
1
+ "use client";
2
+
3
+ import { useEffect, useState } from "react";
4
+
5
+ const MESSAGES: Record<string, string> = {
6
+ state_mismatch: "Sign-in didn't complete. Please try again.",
7
+ exchange_failed: "We couldn't finish signing you in. Please try again.",
8
+ missing_code: "Sign-in didn't complete. Please try again.",
9
+ missing_id_token: "Sign-in didn't complete. Please try again.",
10
+ id_token_invalid: "Sign-in didn't complete. Please try again.",
11
+ access_denied: "Sign-in was cancelled.",
12
+ login_required: "Please sign in to continue.",
13
+ };
14
+
15
+ export function AuthErrorToast() {
16
+ const [message, setMessage] = useState<string | null>(null);
17
+
18
+ useEffect(() => {
19
+ const url = new URL(window.location.href);
20
+ const err = url.searchParams.get("cimplify_auth_error");
21
+ if (!err) return;
22
+ setMessage(MESSAGES[err] ?? "Sign-in didn't complete. Please try again.");
23
+ url.searchParams.delete("cimplify_auth_error");
24
+ window.history.replaceState(null, "", url.toString());
25
+ }, []);
26
+
27
+ if (!message) return null;
28
+
29
+ return (
30
+ <div
31
+ role="status"
32
+ aria-live="polite"
33
+ className="fixed bottom-4 left-1/2 -translate-x-1/2 z-50 max-w-sm rounded-lg bg-zinc-900 text-white px-4 py-3 text-sm shadow-lg flex items-center gap-3"
34
+ >
35
+ <span>{message}</span>
36
+ <button
37
+ type="button"
38
+ onClick={() => setMessage(null)}
39
+ aria-label="Dismiss"
40
+ className="text-zinc-400 hover:text-white transition-colors text-base leading-none"
41
+ >
42
+ ×
43
+ </button>
44
+ </div>
45
+ );
46
+ }
@@ -3,6 +3,7 @@
3
3
  import { useMemo, type ReactNode } from "react";
4
4
  import { createCimplifyClient } from "@cimplify/sdk";
5
5
  import { CimplifyProvider, CartDrawerProvider } from "@cimplify/sdk/react";
6
+ import { AuthErrorToast } from "@/components/auth-error-toast";
6
7
 
7
8
  // Same-origin client — every request goes through the Next.js rewrite in
8
9
  // next.config.ts, so no CORS preflight ever hits the browser.
@@ -20,7 +21,10 @@ export function Providers({ children }: { children: ReactNode }) {
20
21
 
21
22
  return (
22
23
  <CimplifyProvider client={client}>
23
- <CartDrawerProvider>{children}</CartDrawerProvider>
24
+ <CartDrawerProvider>
25
+ {children}
26
+ <AuthErrorToast />
27
+ </CartDrawerProvider>
24
28
  </CimplifyProvider>
25
29
  );
26
30
  }
@@ -0,0 +1,46 @@
1
+ "use client";
2
+
3
+ import { useEffect, useState } from "react";
4
+
5
+ const MESSAGES: Record<string, string> = {
6
+ state_mismatch: "Sign-in didn't complete. Please try again.",
7
+ exchange_failed: "We couldn't finish signing you in. Please try again.",
8
+ missing_code: "Sign-in didn't complete. Please try again.",
9
+ missing_id_token: "Sign-in didn't complete. Please try again.",
10
+ id_token_invalid: "Sign-in didn't complete. Please try again.",
11
+ access_denied: "Sign-in was cancelled.",
12
+ login_required: "Please sign in to continue.",
13
+ };
14
+
15
+ export function AuthErrorToast() {
16
+ const [message, setMessage] = useState<string | null>(null);
17
+
18
+ useEffect(() => {
19
+ const url = new URL(window.location.href);
20
+ const err = url.searchParams.get("cimplify_auth_error");
21
+ if (!err) return;
22
+ setMessage(MESSAGES[err] ?? "Sign-in didn't complete. Please try again.");
23
+ url.searchParams.delete("cimplify_auth_error");
24
+ window.history.replaceState(null, "", url.toString());
25
+ }, []);
26
+
27
+ if (!message) return null;
28
+
29
+ return (
30
+ <div
31
+ role="status"
32
+ aria-live="polite"
33
+ className="fixed bottom-4 left-1/2 -translate-x-1/2 z-50 max-w-sm rounded-lg bg-zinc-900 text-white px-4 py-3 text-sm shadow-lg flex items-center gap-3"
34
+ >
35
+ <span>{message}</span>
36
+ <button
37
+ type="button"
38
+ onClick={() => setMessage(null)}
39
+ aria-label="Dismiss"
40
+ className="text-zinc-400 hover:text-white transition-colors text-base leading-none"
41
+ >
42
+ ×
43
+ </button>
44
+ </div>
45
+ );
46
+ }
@@ -3,6 +3,7 @@
3
3
  import { useMemo, type ReactNode } from "react";
4
4
  import { createCimplifyClient } from "@cimplify/sdk";
5
5
  import { CimplifyProvider, CartDrawerProvider } from "@cimplify/sdk/react";
6
+ import { AuthErrorToast } from "@/components/auth-error-toast";
6
7
 
7
8
  // Same-origin client — every request goes through the Next.js rewrite in
8
9
  // next.config.ts, so no CORS preflight ever hits the browser.
@@ -20,7 +21,10 @@ export function Providers({ children }: { children: ReactNode }) {
20
21
 
21
22
  return (
22
23
  <CimplifyProvider client={client}>
23
- <CartDrawerProvider>{children}</CartDrawerProvider>
24
+ <CartDrawerProvider>
25
+ {children}
26
+ <AuthErrorToast />
27
+ </CartDrawerProvider>
24
28
  </CimplifyProvider>
25
29
  );
26
30
  }
@@ -0,0 +1,46 @@
1
+ "use client";
2
+
3
+ import { useEffect, useState } from "react";
4
+
5
+ const MESSAGES: Record<string, string> = {
6
+ state_mismatch: "Sign-in didn't complete. Please try again.",
7
+ exchange_failed: "We couldn't finish signing you in. Please try again.",
8
+ missing_code: "Sign-in didn't complete. Please try again.",
9
+ missing_id_token: "Sign-in didn't complete. Please try again.",
10
+ id_token_invalid: "Sign-in didn't complete. Please try again.",
11
+ access_denied: "Sign-in was cancelled.",
12
+ login_required: "Please sign in to continue.",
13
+ };
14
+
15
+ export function AuthErrorToast() {
16
+ const [message, setMessage] = useState<string | null>(null);
17
+
18
+ useEffect(() => {
19
+ const url = new URL(window.location.href);
20
+ const err = url.searchParams.get("cimplify_auth_error");
21
+ if (!err) return;
22
+ setMessage(MESSAGES[err] ?? "Sign-in didn't complete. Please try again.");
23
+ url.searchParams.delete("cimplify_auth_error");
24
+ window.history.replaceState(null, "", url.toString());
25
+ }, []);
26
+
27
+ if (!message) return null;
28
+
29
+ return (
30
+ <div
31
+ role="status"
32
+ aria-live="polite"
33
+ className="fixed bottom-4 left-1/2 -translate-x-1/2 z-50 max-w-sm rounded-lg bg-zinc-900 text-white px-4 py-3 text-sm shadow-lg flex items-center gap-3"
34
+ >
35
+ <span>{message}</span>
36
+ <button
37
+ type="button"
38
+ onClick={() => setMessage(null)}
39
+ aria-label="Dismiss"
40
+ className="text-zinc-400 hover:text-white transition-colors text-base leading-none"
41
+ >
42
+ ×
43
+ </button>
44
+ </div>
45
+ );
46
+ }
@@ -3,6 +3,7 @@
3
3
  import { useMemo, type ReactNode } from "react";
4
4
  import { createCimplifyClient } from "@cimplify/sdk";
5
5
  import { CimplifyProvider, CartDrawerProvider } from "@cimplify/sdk/react";
6
+ import { AuthErrorToast } from "@/components/auth-error-toast";
6
7
 
7
8
  // Same-origin client — every request goes through the Next.js rewrite in
8
9
  // next.config.ts, so no CORS preflight ever hits the browser.
@@ -20,7 +21,10 @@ export function Providers({ children }: { children: ReactNode }) {
20
21
 
21
22
  return (
22
23
  <CimplifyProvider client={client}>
23
- <CartDrawerProvider>{children}</CartDrawerProvider>
24
+ <CartDrawerProvider>
25
+ {children}
26
+ <AuthErrorToast />
27
+ </CartDrawerProvider>
24
28
  </CimplifyProvider>
25
29
  );
26
30
  }
@@ -0,0 +1,46 @@
1
+ "use client";
2
+
3
+ import { useEffect, useState } from "react";
4
+
5
+ const MESSAGES: Record<string, string> = {
6
+ state_mismatch: "Sign-in didn't complete. Please try again.",
7
+ exchange_failed: "We couldn't finish signing you in. Please try again.",
8
+ missing_code: "Sign-in didn't complete. Please try again.",
9
+ missing_id_token: "Sign-in didn't complete. Please try again.",
10
+ id_token_invalid: "Sign-in didn't complete. Please try again.",
11
+ access_denied: "Sign-in was cancelled.",
12
+ login_required: "Please sign in to continue.",
13
+ };
14
+
15
+ export function AuthErrorToast() {
16
+ const [message, setMessage] = useState<string | null>(null);
17
+
18
+ useEffect(() => {
19
+ const url = new URL(window.location.href);
20
+ const err = url.searchParams.get("cimplify_auth_error");
21
+ if (!err) return;
22
+ setMessage(MESSAGES[err] ?? "Sign-in didn't complete. Please try again.");
23
+ url.searchParams.delete("cimplify_auth_error");
24
+ window.history.replaceState(null, "", url.toString());
25
+ }, []);
26
+
27
+ if (!message) return null;
28
+
29
+ return (
30
+ <div
31
+ role="status"
32
+ aria-live="polite"
33
+ className="fixed bottom-4 left-1/2 -translate-x-1/2 z-50 max-w-sm rounded-lg bg-zinc-900 text-white px-4 py-3 text-sm shadow-lg flex items-center gap-3"
34
+ >
35
+ <span>{message}</span>
36
+ <button
37
+ type="button"
38
+ onClick={() => setMessage(null)}
39
+ aria-label="Dismiss"
40
+ className="text-zinc-400 hover:text-white transition-colors text-base leading-none"
41
+ >
42
+ ×
43
+ </button>
44
+ </div>
45
+ );
46
+ }
@@ -3,6 +3,7 @@
3
3
  import { useMemo, type ReactNode } from "react";
4
4
  import { createCimplifyClient } from "@cimplify/sdk";
5
5
  import { CimplifyProvider, CartDrawerProvider } from "@cimplify/sdk/react";
6
+ import { AuthErrorToast } from "@/components/auth-error-toast";
6
7
 
7
8
  // Same-origin client — every request goes through the Next.js rewrite in
8
9
  // next.config.ts, so no CORS preflight ever hits the browser.
@@ -20,7 +21,10 @@ export function Providers({ children }: { children: ReactNode }) {
20
21
 
21
22
  return (
22
23
  <CimplifyProvider client={client}>
23
- <CartDrawerProvider>{children}</CartDrawerProvider>
24
+ <CartDrawerProvider>
25
+ {children}
26
+ <AuthErrorToast />
27
+ </CartDrawerProvider>
24
28
  </CimplifyProvider>
25
29
  );
26
30
  }
@@ -0,0 +1,46 @@
1
+ "use client";
2
+
3
+ import { useEffect, useState } from "react";
4
+
5
+ const MESSAGES: Record<string, string> = {
6
+ state_mismatch: "Sign-in didn't complete. Please try again.",
7
+ exchange_failed: "We couldn't finish signing you in. Please try again.",
8
+ missing_code: "Sign-in didn't complete. Please try again.",
9
+ missing_id_token: "Sign-in didn't complete. Please try again.",
10
+ id_token_invalid: "Sign-in didn't complete. Please try again.",
11
+ access_denied: "Sign-in was cancelled.",
12
+ login_required: "Please sign in to continue.",
13
+ };
14
+
15
+ export function AuthErrorToast() {
16
+ const [message, setMessage] = useState<string | null>(null);
17
+
18
+ useEffect(() => {
19
+ const url = new URL(window.location.href);
20
+ const err = url.searchParams.get("cimplify_auth_error");
21
+ if (!err) return;
22
+ setMessage(MESSAGES[err] ?? "Sign-in didn't complete. Please try again.");
23
+ url.searchParams.delete("cimplify_auth_error");
24
+ window.history.replaceState(null, "", url.toString());
25
+ }, []);
26
+
27
+ if (!message) return null;
28
+
29
+ return (
30
+ <div
31
+ role="status"
32
+ aria-live="polite"
33
+ className="fixed bottom-4 left-1/2 -translate-x-1/2 z-50 max-w-sm rounded-lg bg-zinc-900 text-white px-4 py-3 text-sm shadow-lg flex items-center gap-3"
34
+ >
35
+ <span>{message}</span>
36
+ <button
37
+ type="button"
38
+ onClick={() => setMessage(null)}
39
+ aria-label="Dismiss"
40
+ className="text-zinc-400 hover:text-white transition-colors text-base leading-none"
41
+ >
42
+ ×
43
+ </button>
44
+ </div>
45
+ );
46
+ }
@@ -3,6 +3,7 @@
3
3
  import { useMemo, type ReactNode } from "react";
4
4
  import { createCimplifyClient } from "@cimplify/sdk";
5
5
  import { CimplifyProvider, CartDrawerProvider } from "@cimplify/sdk/react";
6
+ import { AuthErrorToast } from "@/components/auth-error-toast";
6
7
 
7
8
  // Same-origin client — every request goes through the Next.js rewrite in
8
9
  // next.config.ts, so no CORS preflight ever hits the browser.
@@ -20,7 +21,10 @@ export function Providers({ children }: { children: ReactNode }) {
20
21
 
21
22
  return (
22
23
  <CimplifyProvider client={client}>
23
- <CartDrawerProvider>{children}</CartDrawerProvider>
24
+ <CartDrawerProvider>
25
+ {children}
26
+ <AuthErrorToast />
27
+ </CartDrawerProvider>
24
28
  </CimplifyProvider>
25
29
  );
26
30
  }
@@ -0,0 +1,46 @@
1
+ "use client";
2
+
3
+ import { useEffect, useState } from "react";
4
+
5
+ const MESSAGES: Record<string, string> = {
6
+ state_mismatch: "Sign-in didn't complete. Please try again.",
7
+ exchange_failed: "We couldn't finish signing you in. Please try again.",
8
+ missing_code: "Sign-in didn't complete. Please try again.",
9
+ missing_id_token: "Sign-in didn't complete. Please try again.",
10
+ id_token_invalid: "Sign-in didn't complete. Please try again.",
11
+ access_denied: "Sign-in was cancelled.",
12
+ login_required: "Please sign in to continue.",
13
+ };
14
+
15
+ export function AuthErrorToast() {
16
+ const [message, setMessage] = useState<string | null>(null);
17
+
18
+ useEffect(() => {
19
+ const url = new URL(window.location.href);
20
+ const err = url.searchParams.get("cimplify_auth_error");
21
+ if (!err) return;
22
+ setMessage(MESSAGES[err] ?? "Sign-in didn't complete. Please try again.");
23
+ url.searchParams.delete("cimplify_auth_error");
24
+ window.history.replaceState(null, "", url.toString());
25
+ }, []);
26
+
27
+ if (!message) return null;
28
+
29
+ return (
30
+ <div
31
+ role="status"
32
+ aria-live="polite"
33
+ className="fixed bottom-4 left-1/2 -translate-x-1/2 z-50 max-w-sm rounded-lg bg-zinc-900 text-white px-4 py-3 text-sm shadow-lg flex items-center gap-3"
34
+ >
35
+ <span>{message}</span>
36
+ <button
37
+ type="button"
38
+ onClick={() => setMessage(null)}
39
+ aria-label="Dismiss"
40
+ className="text-zinc-400 hover:text-white transition-colors text-base leading-none"
41
+ >
42
+ ×
43
+ </button>
44
+ </div>
45
+ );
46
+ }
@@ -3,6 +3,7 @@
3
3
  import { useMemo, type ReactNode } from "react";
4
4
  import { createCimplifyClient } from "@cimplify/sdk";
5
5
  import { CimplifyProvider, CartDrawerProvider } from "@cimplify/sdk/react";
6
+ import { AuthErrorToast } from "@/components/auth-error-toast";
6
7
 
7
8
  // Same-origin client — every request goes through the Next.js rewrite in
8
9
  // next.config.ts, so no CORS preflight ever hits the browser.
@@ -20,7 +21,10 @@ export function Providers({ children }: { children: ReactNode }) {
20
21
 
21
22
  return (
22
23
  <CimplifyProvider client={client}>
23
- <CartDrawerProvider>{children}</CartDrawerProvider>
24
+ <CartDrawerProvider>
25
+ {children}
26
+ <AuthErrorToast />
27
+ </CartDrawerProvider>
24
28
  </CimplifyProvider>
25
29
  );
26
30
  }