@molecule/app-auth-modal-vue 0.0.0-stage → 1.1.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.
package/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
package/README.md CHANGED
@@ -1,3 +1,385 @@
1
- # Temporary Holding Version
1
+ <!--
2
+ AUTO-GENERATED — DO NOT EDIT THIS FILE.
3
+ Generated by `mlcl sync-docs` from the package's src/index.ts JSDoc + mlcl/registry.json.
4
+ Edits here are overwritten on the next commit (molecule's pre-commit hook regenerates).
5
+ To change this document, edit the module-level JSDoc in src/index.ts.
6
+ Generated: 2026-11-21T12:46:15.790Z
7
+ -->
2
8
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
9
+ # @molecule/app-auth-modal-vue
10
+
11
+ `@molecule/app-auth-modal-vue` — the shared in-app login / signup /
12
+ upgrade flow. Mount {@link AuthModalMount} ONCE inside the app's
13
+ providers (where the `@molecule/app-vue` auth composables work) and every
14
+ in-app `/login` / `/signup` link opens the {@link AuthModal} instead of
15
+ navigating, while `/pricing` / `/billing` links open the upgrade flow in
16
+ a new tab (session auto-refreshes when the user returns) — no
17
+ navigation, no reload, no lost work. OAuth runs in a popup
18
+ (`loginViaPopup`), so social login never navigates the host either.
19
+
20
+ > **Auto-generated, AI-first package reference** for the [molecule.dev](https://molecule.dev) ecosystem.
21
+ > It is written to be read by coding agents as much as by people, and is generated from this
22
+ > package's source — edit `src/index.ts` JSDoc, not this file.
23
+
24
+ ## Quick Start
25
+
26
+ ```ts
27
+ import { createApp, defineComponent, h } from 'vue'
28
+ import { AuthModalMount } from '@molecule/app-auth-modal-vue'
29
+ import { oauthConfig } from './config.js'
30
+
31
+ // Once, inside the app's providers (e.g. in App.ts):
32
+ const App = defineComponent({
33
+ setup() {
34
+ return () => h(AuthModalMount, { oauthConfig, onAuthenticated: () => claimGuestWork() })
35
+ },
36
+ })
37
+ // Every plain <a href="/login">, <a href="/signup">, <a href="/pricing">
38
+ // anywhere in the app is now intercepted — no other wiring needed.
39
+
40
+ createApp(App).mount('#app')
41
+ ```
42
+
43
+ ## Type
44
+
45
+ `feature`
46
+
47
+ ## Installation
48
+
49
+ ```bash
50
+ npm install @molecule/app-auth-modal-vue @molecule/app-auth-shell-vue @molecule/app-i18n @molecule/app-oauth-buttons-vue @molecule/app-ui @molecule/app-ui-vue @molecule/app-vue vue
51
+ ```
52
+
53
+ ## API
54
+
55
+ ### Interfaces
56
+
57
+ #### `AuthModalProps`
58
+
59
+ Props for {@link AuthModal}.
60
+
61
+ ```typescript
62
+ interface AuthModalProps {
63
+ /** Whether the modal is open. */
64
+ open: boolean
65
+ /** Close without authenticating (backdrop / Escape / ✕). */
66
+ onClose?: () => void
67
+ /** Which form to open on. Defaults to `'signup'`. */
68
+ initialMode?: AuthModalMode
69
+ /**
70
+ * OAuth config consumed by `useOAuth()` — `{ baseURL, oauthProviders, oauthEndpoint }`
71
+ * from the app's `config.ts`. Drives the popup OAuth buttons.
72
+ */
73
+ oauthConfig: UseOAuthConfig
74
+ /**
75
+ * Run synchronously BEFORE any login/signup/OAuth attempt — e.g. stash the guest
76
+ * id so the new session can claim its work. Optional.
77
+ */
78
+ onBeforeAuth?: () => void
79
+ /**
80
+ * Run AFTER a successful login/signup/OAuth (the session is already refreshed),
81
+ * still on the same page — e.g. claim guest projects, invalidate usage. Optional.
82
+ */
83
+ onAuthenticated?: () => void | Promise<void>
84
+ /**
85
+ * A human-verification challenge rendered inside the SIGNUP form, above the
86
+ * submit button (e.g. the app's Turnstile/hCaptcha widget). Login is not
87
+ * gated, so the slot is unmounted in login mode — which lets the widget clear
88
+ * its own token when the user switches tabs and re-issue a fresh one on the
89
+ * way back. Passed as a prop or as the same-named slot.
90
+ *
91
+ * The modal stays provider-agnostic: it renders the node and never inspects
92
+ * it. An app whose signup API requires a challenge MUST pass
93
+ * {@link AuthModalProps.captchaSolved} as well, or the form will submit
94
+ * without a token and the API will reject it.
95
+ *
96
+ * Optional — omitted (the default for apps with no challenge) the signup form
97
+ * is unchanged.
98
+ */
99
+ captchaSlot?: VNodeChild | null
100
+ /**
101
+ * Whether the {@link AuthModalProps.captchaSlot} challenge is currently
102
+ * solved. `false` disables the signup submit, so the form cannot POST a
103
+ * missing/expired token. Defaults to `true` (no challenge → nothing to wait
104
+ * for). Ignored in login mode.
105
+ */
106
+ captchaSolved?: boolean
107
+ }
108
+ ```
109
+
110
+ #### `AuthModalMountProps`
111
+
112
+ Props for {@link AuthModalMount}.
113
+
114
+ ```typescript
115
+ interface AuthModalMountProps {
116
+ /** OAuth config from the app's `config.ts` (drives the popup OAuth buttons). */
117
+ oauthConfig: AuthModalProps['oauthConfig']
118
+ /** Run before any login attempt (e.g. stash the guest id). Optional. */
119
+ onBeforeAuth?: () => void
120
+ /** Run after a successful login (session already refreshed). Optional. */
121
+ onAuthenticated?: () => void | Promise<void>
122
+ /**
123
+ * Run when the user returns to this tab after the upgrade tab (the session is
124
+ * already refreshed here) — e.g. invalidate usage so a budget banner clears.
125
+ * Only fires for the default new-tab flow; irrelevant when
126
+ * {@link AuthModalMountProps.onUpgradeIntercept} is set. Optional.
127
+ */
128
+ onUpgradeReturn?: () => void
129
+ /**
130
+ * Take over upgrade/billing CTA clicks instead of opening a new tab: called
131
+ * with the matched upgrade path (e.g. `/pricing`), navigation already
132
+ * prevented. The host renders its own upgrade UI (typically a modal) and owns
133
+ * refreshing the session when that flow completes. Optional — when omitted,
134
+ * the default new-tab flow (+ focus-return refresh) applies.
135
+ */
136
+ onUpgradeIntercept?: (path: string) => void
137
+ /**
138
+ * Human-verification challenge rendered inside the modal's SIGNUP form — see
139
+ * {@link AuthModalProps.captchaSlot}. Pass it together with
140
+ * {@link AuthModalMountProps.captchaSolved} whenever the app's signup API
141
+ * requires a challenge token, otherwise the in-app signup POSTs without one
142
+ * while the standalone `/signup` page (which renders its own widget) works —
143
+ * a mismatch the user experiences as "complete the challenge" with no
144
+ * challenge on screen. Optional.
145
+ */
146
+ captchaSlot?: AuthModalProps['captchaSlot']
147
+ /** Whether {@link AuthModalMountProps.captchaSlot} is solved; `false` disables the signup submit. Defaults to `true`. */
148
+ captchaSolved?: boolean
149
+ /** Override the auth path→mode map (defaults to `/login`,`/signup`). */
150
+ authPaths?: Readonly<Record<string, AuthModalMode>>
151
+ /** Override the upgrade paths opened in a new tab (defaults to `/pricing`,`/billing`). */
152
+ upgradePaths?: readonly string[]
153
+ }
154
+ ```
155
+
156
+ ### Types
157
+
158
+ #### `AuthModalMode`
159
+
160
+ Which form {@link AuthModal} should show.
161
+
162
+ ```typescript
163
+ type AuthModalMode = 'login' | 'signup'
164
+ ```
165
+
166
+ ### Functions
167
+
168
+ #### `authModeForHref(href, origin, authPaths)`
169
+
170
+ Map a CTA link's href to the auth mode it should open, or `null` if it is not
171
+ an auth link (so the interceptor leaves it alone).
172
+
173
+ ```typescript
174
+ function authModeForHref(
175
+ href: string | null | undefined,
176
+ origin: string,
177
+ authPaths?: Readonly<Record<string, AuthModalMode>>,
178
+ ): AuthModalMode | null
179
+ ```
180
+
181
+ - `href` — The clicked anchor's href (relative or absolute).
182
+ - `origin` — The page origin to resolve a relative href against.
183
+ - `authPaths` — Path→mode map (defaults to {@link DEFAULT_AUTH_PATHS}).
184
+
185
+ **Returns:** `'login'` / `'signup'`, else `null`.
186
+
187
+ #### `upgradePathForHref(href, origin, upgradePaths)`
188
+
189
+ Whether a CTA link's href points at the upgrade/billing flow (which the
190
+ interceptor hands to the host's `onUpgradeIntercept`, else opens in a new tab).
191
+
192
+ ```typescript
193
+ function upgradePathForHref(
194
+ href: string | null | undefined,
195
+ origin: string,
196
+ upgradePaths?: readonly string[],
197
+ ): string | null
198
+ ```
199
+
200
+ - `href` — The clicked anchor's href (relative or absolute).
201
+ - `origin` — The page origin to resolve a relative href against.
202
+ - `upgradePaths` — The upgrade paths (defaults to {@link DEFAULT_UPGRADE_PATHS}).
203
+
204
+ **Returns:** The matched pathname, else `null`.
205
+
206
+ ### Constants
207
+
208
+ #### `AuthModal`
209
+
210
+ The in-app auth modal: login/signup tabs rendered in a Modal overlay — the user authenticates without leaving the current page (no navigation, no lost work). Usually rendered via `AuthModalMount`, not directly.
211
+
212
+ ```typescript
213
+ const AuthModal: DefineComponent<
214
+ ExtractPropTypes<{
215
+ open: { type: BooleanConstructor; default: boolean }
216
+ onClose: PropType<() => void>
217
+ initialMode: { type: PropType<AuthModalMode>; default: string }
218
+ oauthConfig: null
219
+ onBeforeAuth: PropType<() => void>
220
+ onAuthenticated: PropType<() => void | Promise<void>>
221
+ captchaSlot: null
222
+ captchaSolved: { type: BooleanConstructor; default: boolean }
223
+ }>,
224
+ () => VNode,
225
+ {},
226
+ {},
227
+ {},
228
+ ComponentOptionsMixin,
229
+ ComponentOptionsMixin,
230
+ {},
231
+ string,
232
+ PublicProps,
233
+ Readonly<
234
+ ExtractPropTypes<{
235
+ open: { type: BooleanConstructor; default: boolean }
236
+ onClose: PropType<() => void>
237
+ initialMode: { type: PropType<AuthModalMode>; default: string }
238
+ oauthConfig: null
239
+ onBeforeAuth: PropType<() => void>
240
+ onAuthenticated: PropType<() => void | Promise<void>>
241
+ captchaSlot: null
242
+ captchaSolved: { type: BooleanConstructor; default: boolean }
243
+ }>
244
+ > &
245
+ Readonly<{}>,
246
+ { open: boolean; initialMode: AuthModalMode; captchaSolved: boolean },
247
+ {},
248
+ {},
249
+ {},
250
+ string,
251
+ ComponentProvideOptions,
252
+ true,
253
+ {},
254
+ any
255
+ >
256
+ ```
257
+
258
+ - `props` — {@link AuthModalProps}.
259
+
260
+ **Returns:** The modal component (renders nothing when closed).
261
+
262
+ #### `AuthModalMount`
263
+
264
+ Mounts the in-app auth modal + the CTA click-interceptor: renders the (initially hidden) AuthModal and installs a capture-phase document click handler that opens it for in-app `/login`/`/signup` links (and routes `/pricing`/`/billing` clicks to the upgrade flow). Mount ONCE inside the app providers.
265
+
266
+ ```typescript
267
+ const AuthModalMount: DefineComponent<
268
+ ExtractPropTypes<{
269
+ oauthConfig: null
270
+ onBeforeAuth: PropType<() => void>
271
+ onAuthenticated: PropType<() => void | Promise<void>>
272
+ onUpgradeReturn: PropType<() => void>
273
+ onUpgradeIntercept: PropType<(path: string) => void>
274
+ captchaSlot: null
275
+ captchaSolved: { type: BooleanConstructor; default: boolean }
276
+ authPaths: { type: PropType<Readonly<Record<string, AuthModalMode>>>; default: undefined }
277
+ upgradePaths: { type: PropType<readonly string[]>; default: undefined }
278
+ }>,
279
+ () => VNode | null,
280
+ {},
281
+ {},
282
+ {},
283
+ ComponentOptionsMixin,
284
+ ComponentOptionsMixin,
285
+ {},
286
+ string,
287
+ PublicProps,
288
+ Readonly<
289
+ ExtractPropTypes<{
290
+ oauthConfig: null
291
+ onBeforeAuth: PropType<() => void>
292
+ onAuthenticated: PropType<() => void | Promise<void>>
293
+ onUpgradeReturn: PropType<() => void>
294
+ onUpgradeIntercept: PropType<(path: string) => void>
295
+ captchaSlot: null
296
+ captchaSolved: { type: BooleanConstructor; default: boolean }
297
+ authPaths: { type: PropType<Readonly<Record<string, AuthModalMode>>>; default: undefined }
298
+ upgradePaths: { type: PropType<readonly string[]>; default: undefined }
299
+ }>
300
+ > &
301
+ Readonly<{}>,
302
+ {
303
+ captchaSolved: boolean
304
+ authPaths: Readonly<Record<string, AuthModalMode>>
305
+ upgradePaths: readonly string[]
306
+ },
307
+ {},
308
+ {},
309
+ {},
310
+ string,
311
+ ComponentProvideOptions,
312
+ true,
313
+ {},
314
+ any
315
+ >
316
+ ```
317
+
318
+ - `props` — {@link AuthModalMountProps}.
319
+
320
+ **Returns:** The (lazily-mounted) auth modal component.
321
+
322
+ #### `DEFAULT_AUTH_PATHS`
323
+
324
+ The default in-app auth routes that open the modal.
325
+
326
+ ```typescript
327
+ const DEFAULT_AUTH_PATHS: Readonly<Record<string, AuthModalMode>>
328
+ ```
329
+
330
+ #### `DEFAULT_UPGRADE_PATHS`
331
+
332
+ The default routes that open the upgrade/billing flow (modal or new tab).
333
+
334
+ ```typescript
335
+ const DEFAULT_UPGRADE_PATHS: readonly string[]
336
+ ```
337
+
338
+ ## Injection Notes
339
+
340
+ ### Requirements
341
+
342
+ Peer dependencies:
343
+
344
+ - `@molecule/app-auth-shell-vue` ^1.0.0
345
+ - `@molecule/app-i18n` ^1.0.1
346
+ - `@molecule/app-oauth-buttons-vue` ^1.0.0
347
+ - `@molecule/app-ui` ^1.0.1
348
+ - `@molecule/app-ui-vue` ^1.1.0
349
+ - `@molecule/app-vue` ^3.6.0
350
+ - `vue` ^3.4.0
351
+
352
+ ### Runtime Dependencies
353
+
354
+ - `@molecule/app-auth-shell-vue`
355
+ - `@molecule/app-i18n`
356
+ - `@molecule/app-oauth-buttons-vue`
357
+ - `@molecule/app-ui`
358
+ - `@molecule/app-ui-vue`
359
+ - `@molecule/app-vue`
360
+ - `vue`
361
+
362
+ Interception is capture-phase on `document` and matches plain
363
+ left-clicks on `<a href>` whose resolved pathname is in `authPaths`
364
+ (default `/login`, `/signup`) or `upgradePaths` (default `/pricing`,
365
+ `/billing`) — modifier/middle clicks still navigate normally, and
366
+ non-anchor buttons that call `navigate()` are NOT intercepted. Hosts
367
+ that render pricing in-place pass `onUpgradeIntercept` and own that UI
368
+
369
+ - the post-upgrade session refresh. `AuthModalMount` must render inside
370
+ the app's auth/HTTP providers (it calls `useAuth`), and the standalone
371
+ `/login` & `/signup` pages should stay routed — they are the fallback
372
+ for modifier clicks and deep links. App-specific extras (stash a guest
373
+ id, claim guest work, invalidate usage) go in `onBeforeAuth` /
374
+ `onAuthenticated`. The modal's `auth.modal.*` strings are homed in the
375
+ `@molecule/app-locales-common` bond (79 languages), alongside the
376
+ `auth.login.*` / `auth.signup.*` keys the modal also renders.
377
+
378
+ If the signup API requires a human-verification challenge (Turnstile /
379
+ hCaptcha), pass BOTH `captchaSlot` (the widget, rendered in the signup
380
+ form — as a prop or a same-named slot) and `captchaSolved` (which gates
381
+ the submit). Rendering the widget on the standalone `/signup` page alone
382
+ is NOT enough: this modal is what a `/signup` link actually opens, so the
383
+ in-app signup would POST with no token and the API would answer "complete
384
+ the verification challenge" while no challenge is on screen. Login is not
385
+ gated, so the slot is unmounted in login mode.