@strands.gg/accui 2.1.2 → 2.1.4

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 (183) hide show
  1. package/dist/index.d.ts +7 -0
  2. package/dist/index.d.ts.map +1 -0
  3. package/dist/nuxt/module.d.ts +6 -0
  4. package/dist/nuxt/module.d.ts.map +1 -0
  5. package/dist/nuxt/runtime/composables/useAuthenticatedFetch.cjs.js +1 -1
  6. package/dist/nuxt/runtime/composables/useAuthenticatedFetch.cjs.js.map +1 -1
  7. package/dist/nuxt/runtime/composables/useAuthenticatedFetch.d.ts +21 -0
  8. package/dist/nuxt/runtime/composables/useAuthenticatedFetch.d.ts.map +1 -0
  9. package/dist/nuxt/runtime/composables/useAuthenticatedFetch.es.js +5 -2
  10. package/dist/nuxt/runtime/composables/useAuthenticatedFetch.es.js.map +1 -1
  11. package/dist/nuxt/runtime/composables/useStrandsAuth.d.ts +143 -0
  12. package/dist/nuxt/runtime/composables/useStrandsAuth.d.ts.map +1 -0
  13. package/dist/nuxt/runtime/middleware/auth.d.ts +8 -0
  14. package/dist/nuxt/runtime/middleware/auth.d.ts.map +1 -0
  15. package/dist/nuxt/runtime/middleware/auth.global.d.ts +4 -0
  16. package/dist/nuxt/runtime/middleware/auth.global.d.ts.map +1 -0
  17. package/dist/nuxt/runtime/middleware/guest.d.ts +8 -0
  18. package/dist/nuxt/runtime/middleware/guest.d.ts.map +1 -0
  19. package/dist/nuxt/runtime/plugin.client.d.ts +4 -0
  20. package/dist/nuxt/runtime/plugin.client.d.ts.map +1 -0
  21. package/dist/nuxt/runtime/plugin.server.d.ts +4 -0
  22. package/dist/nuxt/runtime/plugin.server.d.ts.map +1 -0
  23. package/dist/nuxt/runtime/plugins/auth-interceptor.client.d.ts +4 -0
  24. package/dist/nuxt/runtime/plugins/auth-interceptor.client.d.ts.map +1 -0
  25. package/dist/nuxt/types.d.ts +46 -0
  26. package/dist/nuxt/types.d.ts.map +1 -0
  27. package/dist/nuxt-v4/module.d.ts +6 -0
  28. package/dist/nuxt-v4/module.d.ts.map +1 -0
  29. package/dist/nuxt-v4/runtime/composables/useAuthenticatedFetch.cjs.js +1 -1
  30. package/dist/nuxt-v4/runtime/composables/useAuthenticatedFetch.cjs.js.map +1 -1
  31. package/dist/nuxt-v4/runtime/composables/useAuthenticatedFetch.d.ts +21 -0
  32. package/dist/nuxt-v4/runtime/composables/useAuthenticatedFetch.d.ts.map +1 -0
  33. package/dist/nuxt-v4/runtime/composables/useAuthenticatedFetch.es.js +5 -2
  34. package/dist/nuxt-v4/runtime/composables/useAuthenticatedFetch.es.js.map +1 -1
  35. package/dist/nuxt-v4/runtime/composables/useStrandsAuth.cjs.js +1 -1
  36. package/dist/nuxt-v4/runtime/composables/useStrandsAuth.cjs.js.map +1 -1
  37. package/dist/nuxt-v4/runtime/composables/useStrandsAuth.d.ts +28 -0
  38. package/dist/nuxt-v4/runtime/composables/useStrandsAuth.d.ts.map +1 -0
  39. package/dist/nuxt-v4/runtime/composables/useStrandsAuth.es.js +1 -0
  40. package/dist/nuxt-v4/runtime/composables/useStrandsAuth.es.js.map +1 -1
  41. package/dist/nuxt-v4/runtime/middleware/auth.global.d.ts +4 -0
  42. package/dist/nuxt-v4/runtime/middleware/auth.global.d.ts.map +1 -0
  43. package/dist/nuxt-v4/runtime/plugin.client.d.ts +4 -0
  44. package/dist/nuxt-v4/runtime/plugin.client.d.ts.map +1 -0
  45. package/dist/nuxt-v4/runtime/plugin.server.d.ts +4 -0
  46. package/dist/nuxt-v4/runtime/plugin.server.d.ts.map +1 -0
  47. package/dist/nuxt-v4/runtime/plugins/auth-interceptor.client.cjs.js.map +1 -1
  48. package/dist/nuxt-v4/runtime/plugins/auth-interceptor.client.d.ts +4 -0
  49. package/dist/nuxt-v4/runtime/plugins/auth-interceptor.client.d.ts.map +1 -0
  50. package/dist/nuxt-v4/runtime/plugins/auth-interceptor.client.es.js.map +1 -1
  51. package/dist/nuxt-v4/types.d.ts +64 -0
  52. package/dist/nuxt-v4/types.d.ts.map +1 -0
  53. package/dist/nuxt-v4.d.ts +5 -0
  54. package/dist/nuxt-v4.d.ts.map +1 -0
  55. package/dist/nuxt.d.ts +5 -0
  56. package/dist/nuxt.d.ts.map +1 -0
  57. package/dist/shared/defaults.d.ts +3 -0
  58. package/dist/shared/defaults.d.ts.map +1 -0
  59. package/dist/strands-auth-ui.cjs.js +1 -1
  60. package/dist/strands-auth-ui.cjs.js.map +1 -1
  61. package/dist/strands-auth-ui.es.js +4 -2
  62. package/dist/strands-auth-ui.es.js.map +1 -1
  63. package/dist/types/index.d.ts +237 -0
  64. package/dist/types/index.d.ts.map +1 -0
  65. package/dist/utils/index.d.ts +2 -0
  66. package/dist/utils/index.d.ts.map +1 -0
  67. package/dist/utils/slots.d.ts +2 -0
  68. package/dist/utils/slots.d.ts.map +1 -0
  69. package/dist/utils/validation.d.ts +13 -0
  70. package/dist/utils/validation.d.ts.map +1 -0
  71. package/dist/vue/components/SignedIn.vue.d.ts +55 -0
  72. package/dist/vue/components/SignedIn.vue.d.ts.map +1 -0
  73. package/dist/vue/components/SignedOut.vue.d.ts +55 -0
  74. package/dist/vue/components/SignedOut.vue.d.ts.map +1 -0
  75. package/dist/vue/components/StrandsAuth.vue.d.ts +26 -0
  76. package/dist/vue/components/StrandsAuth.vue.d.ts.map +1 -0
  77. package/dist/vue/components/StrandsBackupCodesModal.vue.d.ts +13 -0
  78. package/dist/vue/components/StrandsBackupCodesModal.vue.d.ts.map +1 -0
  79. package/dist/vue/components/StrandsCompleteSignUp.vue.d.ts +22 -0
  80. package/dist/vue/components/StrandsCompleteSignUp.vue.d.ts.map +1 -0
  81. package/dist/vue/components/StrandsConfigProvider.vue.d.ts +23 -0
  82. package/dist/vue/components/StrandsConfigProvider.vue.d.ts.map +1 -0
  83. package/dist/vue/components/StrandsConfirmModal.vue.d.ts +23 -0
  84. package/dist/vue/components/StrandsConfirmModal.vue.d.ts.map +1 -0
  85. package/dist/vue/components/StrandsEmailMfaSetupModal.vue.d.ts +13 -0
  86. package/dist/vue/components/StrandsEmailMfaSetupModal.vue.d.ts.map +1 -0
  87. package/dist/vue/components/StrandsHardwareKeySetupModal.vue.d.ts +16 -0
  88. package/dist/vue/components/StrandsHardwareKeySetupModal.vue.d.ts.map +1 -0
  89. package/dist/vue/components/StrandsLogo.vue.d.ts +9 -0
  90. package/dist/vue/components/StrandsLogo.vue.d.ts.map +1 -0
  91. package/dist/vue/components/StrandsMFASetup.vue.d.ts +17 -0
  92. package/dist/vue/components/StrandsMFASetup.vue.d.ts.map +1 -0
  93. package/dist/vue/components/StrandsMfaModal.vue.d.ts +13 -0
  94. package/dist/vue/components/StrandsMfaModal.vue.d.ts.map +1 -0
  95. package/dist/vue/components/StrandsMfaVerification.vue.d.ts +18 -0
  96. package/dist/vue/components/StrandsMfaVerification.vue.d.ts.map +1 -0
  97. package/dist/vue/components/StrandsPasswordReset.vue.d.ts +16 -0
  98. package/dist/vue/components/StrandsPasswordReset.vue.d.ts.map +1 -0
  99. package/dist/vue/components/StrandsSecuredFooter.vue.d.ts +23 -0
  100. package/dist/vue/components/StrandsSecuredFooter.vue.d.ts.map +1 -0
  101. package/dist/vue/components/StrandsSessionsModal.vue.d.ts +15 -0
  102. package/dist/vue/components/StrandsSessionsModal.vue.d.ts.map +1 -0
  103. package/dist/vue/components/StrandsSettingsModal.vue.d.ts +19 -0
  104. package/dist/vue/components/StrandsSettingsModal.vue.d.ts.map +1 -0
  105. package/dist/vue/components/StrandsSignIn.vue.d.ts +22 -0
  106. package/dist/vue/components/StrandsSignIn.vue.d.ts.map +1 -0
  107. package/dist/vue/components/StrandsSignUp.vue.d.ts +20 -0
  108. package/dist/vue/components/StrandsSignUp.vue.d.ts.map +1 -0
  109. package/dist/vue/components/StrandsTotpSetupModal.vue.d.ts +13 -0
  110. package/dist/vue/components/StrandsTotpSetupModal.vue.d.ts.map +1 -0
  111. package/dist/vue/components/StrandsUserButton.vue.d.ts +31 -0
  112. package/dist/vue/components/StrandsUserButton.vue.d.ts.map +1 -0
  113. package/dist/vue/components/StrandsUserProfile.vue.d.ts +27 -0
  114. package/dist/vue/components/StrandsUserProfile.vue.d.ts.map +1 -0
  115. package/dist/vue/components/SvgIcon.vue.d.ts +18 -0
  116. package/dist/vue/components/SvgIcon.vue.d.ts.map +1 -0
  117. package/dist/vue/components/VirtualList.vue.d.ts +38 -0
  118. package/dist/vue/components/VirtualList.vue.d.ts.map +1 -0
  119. package/dist/vue/components/icons/IconGithub.vue.d.ts +4 -0
  120. package/dist/vue/components/icons/IconGithub.vue.d.ts.map +1 -0
  121. package/dist/vue/components/icons/IconGoogle.vue.d.ts +4 -0
  122. package/dist/vue/components/icons/IconGoogle.vue.d.ts.map +1 -0
  123. package/dist/vue/components/icons/index.d.ts +3 -0
  124. package/dist/vue/components/icons/index.d.ts.map +1 -0
  125. package/dist/vue/components/index.d.ts +27 -0
  126. package/dist/vue/components/index.d.ts.map +1 -0
  127. package/dist/vue/composables/useAuthenticatedFetch.d.ts +21 -0
  128. package/dist/vue/composables/useAuthenticatedFetch.d.ts.map +1 -0
  129. package/dist/vue/composables/useOAuthProviders.d.ts +75 -0
  130. package/dist/vue/composables/useOAuthProviders.d.ts.map +1 -0
  131. package/dist/vue/composables/useStrandsAuth.d.ts +131 -0
  132. package/dist/vue/composables/useStrandsAuth.d.ts.map +1 -0
  133. package/dist/vue/composables/useStrandsConfig.d.ts +12 -0
  134. package/dist/vue/composables/useStrandsConfig.d.ts.map +1 -0
  135. package/dist/vue/composables/useStrandsMfa.d.ts +39 -0
  136. package/dist/vue/composables/useStrandsMfa.d.ts.map +1 -0
  137. package/dist/vue/index.d.ts +13 -0
  138. package/dist/vue/index.d.ts.map +1 -0
  139. package/dist/vue/plugins/StrandsUIPlugin.d.ts +20 -0
  140. package/dist/vue/plugins/StrandsUIPlugin.d.ts.map +1 -0
  141. package/dist/vue/ui/UiAlert.vue.d.ts +32 -0
  142. package/dist/vue/ui/UiAlert.vue.d.ts.map +1 -0
  143. package/dist/vue/ui/UiAvatarEditor.vue.d.ts +26 -0
  144. package/dist/vue/ui/UiAvatarEditor.vue.d.ts.map +1 -0
  145. package/dist/vue/ui/UiButton.vue.d.ts +55 -0
  146. package/dist/vue/ui/UiButton.vue.d.ts.map +1 -0
  147. package/dist/vue/ui/UiCard.vue.d.ts +30 -0
  148. package/dist/vue/ui/UiCard.vue.d.ts.map +1 -0
  149. package/dist/vue/ui/UiInput.vue.d.ts +49 -0
  150. package/dist/vue/ui/UiInput.vue.d.ts.map +1 -0
  151. package/dist/vue/ui/UiLevelProgress.vue.d.ts +20 -0
  152. package/dist/vue/ui/UiLevelProgress.vue.d.ts.map +1 -0
  153. package/dist/vue/ui/UiLink.vue.d.ts +43 -0
  154. package/dist/vue/ui/UiLink.vue.d.ts.map +1 -0
  155. package/dist/vue/ui/UiLoader.vue.d.ts +16 -0
  156. package/dist/vue/ui/UiLoader.vue.d.ts.map +1 -0
  157. package/dist/vue/ui/UiModal.vue.d.ts +34 -0
  158. package/dist/vue/ui/UiModal.vue.d.ts.map +1 -0
  159. package/dist/vue/ui/UiTabs.vue.d.ts +18 -0
  160. package/dist/vue/ui/UiTabs.vue.d.ts.map +1 -0
  161. package/dist/vue/ui/UiToggle.vue.d.ts +16 -0
  162. package/dist/vue/ui/UiToggle.vue.d.ts.map +1 -0
  163. package/dist/vue/ui/index.d.ts +30 -0
  164. package/dist/vue/ui/index.d.ts.map +1 -0
  165. package/dist/vue/utils/contrast.d.ts +80 -0
  166. package/dist/vue/utils/contrast.d.ts.map +1 -0
  167. package/dist/vue/utils/debounce.d.ts +13 -0
  168. package/dist/vue/utils/debounce.d.ts.map +1 -0
  169. package/dist/vue/utils/fontPreloader.d.ts +20 -0
  170. package/dist/vue/utils/fontPreloader.d.ts.map +1 -0
  171. package/dist/vue/utils/iconProps.d.ts +10 -0
  172. package/dist/vue/utils/iconProps.d.ts.map +1 -0
  173. package/dist/vue/utils/lazyComponents.d.ts +3 -0
  174. package/dist/vue/utils/lazyComponents.d.ts.map +1 -0
  175. package/dist/vue/utils/levels.d.ts +28 -0
  176. package/dist/vue/utils/levels.d.ts.map +1 -0
  177. package/dist/vue/utils/performanceInit.d.ts +41 -0
  178. package/dist/vue/utils/performanceInit.d.ts.map +1 -0
  179. package/dist/vue/utils/requestCache.d.ts +50 -0
  180. package/dist/vue/utils/requestCache.d.ts.map +1 -0
  181. package/dist/vue/utils/sounds.d.ts +57 -0
  182. package/dist/vue/utils/sounds.d.ts.map +1 -0
  183. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"useAuthenticatedFetch.es.js","sources":["../../../../../../apps/accounts-ui/src/nuxt-v4/runtime/composables/useAuthenticatedFetch.ts"],"sourcesContent":["import { useStrandsAuth } from './useStrandsAuth'\nimport type { AuthenticatedFetchOptions } from '../../../types'\n\n/**\n * Enhanced fetch composable that automatically includes auth headers\n * and handles token refresh for API requests\n */\nexport function useAuthenticatedFetch() {\n const { currentSession, refreshToken, getAuthHeaders } = useStrandsAuth()\n\n const authenticatedFetch = async (\n url: string | URL,\n options: AuthenticatedFetchOptions = {}\n ): Promise<Response> => {\n const {\n autoRefresh = true,\n requireAuth = true,\n baseURL,\n ...fetchOptions\n } = options\n\n // Check if user is authenticated when required\n if (requireAuth && !currentSession.value?.accessToken) {\n throw new Error('User is not authenticated')\n }\n\n // Construct full URL if baseURL is provided\n let fullUrl: string | URL = url\n if (baseURL && typeof url === 'string' && !url.startsWith('http')) {\n fullUrl = new URL(url, baseURL).toString()\n }\n\n // Prepare headers\n const headers = new Headers(fetchOptions.headers)\n \n // Add auth headers if available\n if (currentSession.value?.accessToken) {\n try {\n const authHeaders = getAuthHeaders()\n Object.entries(authHeaders).forEach(([key, value]) => {\n headers.set(key, value)\n })\n } catch (error) {\n console.warn('[Strands Auth] Failed to get auth headers:', error)\n if (requireAuth) {\n throw error\n }\n }\n }\n\n // Make the request\n const enhancedOptions: RequestInit = {\n ...fetchOptions,\n headers\n }\n\n let response = await fetch(fullUrl, enhancedOptions)\n\n // Handle 401 with auto-refresh\n if (response.status === 401 && autoRefresh && currentSession.value?.refreshToken) {\n console.log('[Strands Auth] Request failed with 401, attempting token refresh...')\n \n try {\n // Attempt to refresh token\n const refreshed = await refreshToken()\n \n if (refreshed && currentSession.value?.accessToken) {\n // Update headers with new token\n const newAuthHeaders = getAuthHeaders()\n Object.entries(newAuthHeaders).forEach(([key, value]) => {\n headers.set(key, value)\n })\n\n // Retry the request with new token\n console.log('[Strands Auth] Retrying request with refreshed token')\n response = await fetch(fullUrl, { ...enhancedOptions, headers })\n }\n } catch (refreshError) {\n console.error('[Strands Auth] Token refresh failed:', refreshError)\n // Return the original 401 response\n }\n }\n\n return response\n }\n\n /**\n * Convenience method for making authenticated GET requests\n */\n const get = (url: string | URL, options?: AuthenticatedFetchOptions) => {\n return authenticatedFetch(url, { ...options, method: 'GET' })\n }\n\n /**\n * Convenience method for making authenticated POST requests\n */\n const post = (url: string | URL, body?: any, options?: AuthenticatedFetchOptions) => {\n const headers = new Headers(options?.headers)\n \n // Auto-set content type for JSON requests\n if (body && typeof body === 'object' && !headers.has('Content-Type')) {\n headers.set('Content-Type', 'application/json')\n }\n\n return authenticatedFetch(url, {\n ...options,\n method: 'POST',\n headers,\n body: typeof body === 'object' ? JSON.stringify(body) : body\n })\n }\n\n /**\n * Convenience method for making authenticated PUT requests\n */\n const put = (url: string | URL, body?: any, options?: AuthenticatedFetchOptions) => {\n const headers = new Headers(options?.headers)\n \n if (body && typeof body === 'object' && !headers.has('Content-Type')) {\n headers.set('Content-Type', 'application/json')\n }\n\n return authenticatedFetch(url, {\n ...options,\n method: 'PUT',\n headers,\n body: typeof body === 'object' ? JSON.stringify(body) : body\n })\n }\n\n /**\n * Convenience method for making authenticated DELETE requests\n */\n const del = (url: string | URL, options?: AuthenticatedFetchOptions) => {\n return authenticatedFetch(url, { ...options, method: 'DELETE' })\n }\n\n /**\n * Convenience method for making authenticated PATCH requests\n */\n const patch = (url: string | URL, body?: any, options?: AuthenticatedFetchOptions) => {\n const headers = new Headers(options?.headers)\n \n if (body && typeof body === 'object' && !headers.has('Content-Type')) {\n headers.set('Content-Type', 'application/json')\n }\n\n return authenticatedFetch(url, {\n ...options,\n method: 'PATCH',\n headers,\n body: typeof body === 'object' ? JSON.stringify(body) : body\n })\n }\n\n return {\n authenticatedFetch,\n get,\n post,\n put,\n delete: del,\n patch\n }\n}\n\n// Export convenience functions for non-composable usage\nexport const $authFetch = {\n get: async (url: string | URL, options?: AuthenticatedFetchOptions) => {\n const { get } = useAuthenticatedFetch()\n return get(url, options)\n },\n post: async (url: string | URL, body?: any, options?: AuthenticatedFetchOptions) => {\n const { post } = useAuthenticatedFetch()\n return post(url, body, options)\n },\n put: async (url: string | URL, body?: any, options?: AuthenticatedFetchOptions) => {\n const { put } = useAuthenticatedFetch()\n return put(url, body, options)\n },\n delete: async (url: string | URL, options?: AuthenticatedFetchOptions) => {\n const { delete: del } = useAuthenticatedFetch()\n return del(url, options)\n },\n patch: async (url: string | URL, body?: any, options?: AuthenticatedFetchOptions) => {\n const { patch } = useAuthenticatedFetch()\n return patch(url, body, options)\n }\n}"],"names":[],"mappings":";AAOO,SAAS,wBAAwB;AACtC,QAAM,EAAE,gBAAgB,cAAc,eAAA,IAAmB,eAAA;AAEzD,QAAM,qBAAqB,OACzB,KACA,UAAqC,CAAA,MACf;AACtB,UAAM;AAAA,MACJ,cAAc;AAAA,MACd,cAAc;AAAA,MACd;AAAA,MACA,GAAG;AAAA,IAAA,IACD;AAGJ,QAAI,eAAe,CAAC,eAAe,OAAO,aAAa;AACrD,YAAM,IAAI,MAAM,2BAA2B;AAAA,IAC7C;AAGA,QAAI,UAAwB;AAC5B,QAAI,WAAW,OAAO,QAAQ,YAAY,CAAC,IAAI,WAAW,MAAM,GAAG;AACjE,gBAAU,IAAI,IAAI,KAAK,OAAO,EAAE,SAAA;AAAA,IAClC;AAGA,UAAM,UAAU,IAAI,QAAQ,aAAa,OAAO;AAGhD,QAAI,eAAe,O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;AAAA,EACA,MAAM,OAAO,KAAmB,MAAY,YAAwC;AAClF,UAAM,EAAE,KAAA,IAAS,sBAAA;AACjB,WAAO,KAAK,KAAK,MAAM,OAAO;AAAA,EAChC;AAAA,EACA,KAAK,OAAO,KAAmB,MAAY,YAAwC;AACjF,UAAM,EAAE,IAAA,IAAQ,sBAAA;AAChB,WAAO,IAAI,KAAK,MAAM,OAAO;AAAA,EAC/B;AAAA,EACA,QAAQ,OAAO,KAAmB,YAAwC;AACxE,UAAM,EAAE,QAAQ,IAAA,IAAQ,sBAAA;AACxB,WAAO,IAAI,KAAK,OAAO;AAAA,EACzB;AAAA,EACA,OAAO,OAAO,KAAmB,MAAY,YAAwC;AACnF,UAAM,EAAE,MAAA,IAAU,sBAAA;AAClB,WAAO,MAAM,KAAK,MAAM,OAAO;AAAA,EACjC;AACF;"}
1
+ {"version":3,"file":"useAuthenticatedFetch.es.js","sources":["../../../../../../apps/accounts-ui/src/nuxt-v4/runtime/composables/useAuthenticatedFetch.ts"],"sourcesContent":["import { useRuntimeConfig } from 'nuxt/app'\nimport { useStrandsAuth } from './useStrandsAuth'\nimport type { AuthenticatedFetchOptions, StrandsAuthConfig } from '../../../types'\n\n/**\n * Enhanced fetch composable that automatically includes auth headers\n * and handles token refresh for API requests\n */\nexport function useAuthenticatedFetch() {\n const config = useRuntimeConfig().public['strandsAuth'] as StrandsAuthConfig\n const { currentSession, refreshToken, getAuthHeaders } = useStrandsAuth()\n\n const authenticatedFetch = async (\n url: string | URL,\n options: AuthenticatedFetchOptions = {}\n ): Promise<Response> => {\n const {\n autoRefresh = true,\n requireAuth = true,\n baseURL,\n ...fetchOptions\n } = options\n\n // Check if user is authenticated when required\n if (requireAuth && !currentSession.value?.accessToken) {\n throw new Error('User is not authenticated')\n }\n\n // Construct full URL using baseURL from options or config\n let fullUrl: string | URL = url\n const resolvedBaseURL = baseURL || config.baseUrl\n \n if (resolvedBaseURL && typeof url === 'string' && !url.startsWith('http')) {\n fullUrl = new URL(url, resolvedBaseURL).toString()\n }\n\n // Prepare headers\n const headers = new Headers(fetchOptions.headers)\n \n // Add auth headers if available\n if (currentSession.value?.accessToken) {\n try {\n const authHeaders = getAuthHeaders()\n Object.entries(authHeaders).forEach(([key, value]) => {\n headers.set(key, value as string)\n })\n } catch (error) {\n console.warn('[Strands Auth] Failed to get auth headers:', error)\n if (requireAuth) {\n throw error\n }\n }\n }\n\n // Make the request\n const enhancedOptions: RequestInit = {\n ...fetchOptions,\n headers\n }\n\n let response = await fetch(fullUrl, enhancedOptions)\n\n // Handle 401 with auto-refresh\n if (response.status === 401 && autoRefresh && currentSession.value?.refreshToken) {\n console.log('[Strands Auth] Request failed with 401, attempting token refresh...')\n \n try {\n // Attempt to refresh token\n const refreshed = await refreshToken()\n \n if (refreshed && currentSession.value?.accessToken) {\n // Update headers with new token\n const newAuthHeaders = getAuthHeaders()\n Object.entries(newAuthHeaders).forEach(([key, value]) => {\n headers.set(key, value as string)\n })\n\n // Retry the request with new token\n console.log('[Strands Auth] Retrying request with refreshed token')\n response = await fetch(fullUrl, { ...enhancedOptions, headers })\n }\n } catch (refreshError) {\n console.error('[Strands Auth] Token refresh failed:', refreshError)\n // Return the original 401 response\n }\n }\n\n return response\n }\n\n /**\n * Convenience method for making authenticated GET requests\n */\n const get = (url: string | URL, options?: AuthenticatedFetchOptions) => {\n return authenticatedFetch(url, { ...options, method: 'GET' })\n }\n\n /**\n * Convenience method for making authenticated POST requests\n */\n const post = (url: string | URL, body?: any, options?: AuthenticatedFetchOptions) => {\n const headers = new Headers(options?.headers)\n \n // Auto-set content type for JSON requests\n if (body && typeof body === 'object' && !headers.has('Content-Type')) {\n headers.set('Content-Type', 'application/json')\n }\n\n return authenticatedFetch(url, {\n ...options,\n method: 'POST',\n headers,\n body: typeof body === 'object' ? JSON.stringify(body) : body\n })\n }\n\n /**\n * Convenience method for making authenticated PUT requests\n */\n const put = (url: string | URL, body?: any, options?: AuthenticatedFetchOptions) => {\n const headers = new Headers(options?.headers)\n \n if (body && typeof body === 'object' && !headers.has('Content-Type')) {\n headers.set('Content-Type', 'application/json')\n }\n\n return authenticatedFetch(url, {\n ...options,\n method: 'PUT',\n headers,\n body: typeof body === 'object' ? JSON.stringify(body) : body\n })\n }\n\n /**\n * Convenience method for making authenticated DELETE requests\n */\n const del = (url: string | URL, options?: AuthenticatedFetchOptions) => {\n return authenticatedFetch(url, { ...options, method: 'DELETE' })\n }\n\n /**\n * Convenience method for making authenticated PATCH requests\n */\n const patch = (url: string | URL, body?: any, options?: AuthenticatedFetchOptions) => {\n const headers = new Headers(options?.headers)\n \n if (body && typeof body === 'object' && !headers.has('Content-Type')) {\n headers.set('Content-Type', 'application/json')\n }\n\n return authenticatedFetch(url, {\n ...options,\n method: 'PATCH',\n headers,\n body: typeof body === 'object' ? JSON.stringify(body) : body\n })\n }\n\n return {\n authenticatedFetch,\n get,\n post,\n put,\n delete: del,\n patch\n }\n}\n\n// Export convenience functions for non-composable usage\nexport const $authFetch = {\n get: async (url: string | URL, options?: AuthenticatedFetchOptions) => {\n const { get } = useAuthenticatedFetch()\n return get(url, options)\n },\n post: async (url: string | URL, body?: any, options?: AuthenticatedFetchOptions) => {\n const { post } = useAuthenticatedFetch()\n return post(url, body, options)\n },\n put: async (url: string | URL, body?: any, options?: AuthenticatedFetchOptions) => {\n const { put } = useAuthenticatedFetch()\n return put(url, body, options)\n },\n delete: async (url: string | URL, options?: AuthenticatedFetchOptions) => {\n const { delete: del } = useAuthenticatedFetch()\n return del(url, options)\n },\n patch: async (url: string | URL, body?: any, options?: AuthenticatedFetchOptions) => {\n const { patch } = useAuthenticatedFetch()\n return patch(url, body, options)\n }\n}"],"names":[],"mappings":";;AAQO,SAAS,wBAAwB;AACtC,QAAM,SAAS,mBAAmB,OAAO,aAAa;AACtD,QAAM,EAAE,gBAAgB,cAAc,eAAA,IAAmB,eAAA;AAEzD,QAAM,qBAAqB,OACzB,KACA,UAAqC,CAAA,MACf;AACtB,UAAM;AAAA,MACJ,cAAc;AA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A,WAAO,mBAAmB,KAAK;AAAA,MAC7B,GAAG;AAAA,MACH,QAAQ;AAAA,MACR;AAAA,MACA,MAAM,OAAO,SAAS,WAAW,KAAK,UAAU,IAAI,IAAI;AAAA,IAAA,CACzD;AAAA,EACH;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,QAAQ;AAAA,IACR;AAAA,EAAA;AAEJ;AAGO,MAAM,aAAa;AAAA,EACxB,KAAK,OAAO,KAAmB,YAAwC;AACrE,UAAM,EAAE,IAAA,IAAQ,sBAAA;AAChB,WAAO,IAAI,KAAK,OAAO;AAAA,EACzB;AAAA,EACA,MAAM,OAAO,KAAmB,MAAY,YAAwC;AAClF,UAAM,EAAE,KAAA,IAAS,sBAAA;AACjB,WAAO,KAAK,KAAK,MAAM,OAAO;AAAA,EAChC;AAAA,EACA,KAAK,OAAO,KAAmB,MAAY,YAAwC;AACjF,UAAM,EAAE,IAAA,IAAQ,sBAAA;AAChB,WAAO,IAAI,KAAK,MAAM,OAAO;AAAA,EAC/B;AAAA,EACA,QAAQ,OAAO,KAAmB,YAAwC;AACxE,UAAM,EAAE,QAAQ,IAAA,IAAQ,sBAAA;AACxB,WAAO,IAAI,KAAK,OAAO;AAAA,EACzB;AAAA,EACA,OAAO,OAAO,KAAmB,MAAY,YAAwC;AACnF,UAAM,EAAE,MAAA,IAAU,sBAAA;AAClB,WAAO,MAAM,KAAK,MAAM,OAAO;AAAA,EACjC;AACF;"}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("nuxt/app"),e=require("../../../useStrandsAuth-CTlaiFqK.cjs"),n=()=>{const n=t.useRuntimeConfig().public.strandsAuth,s=e.useStrandsAuth();return{user:s.user,currentUser:s.currentUser,currentSession:s.currentSession,isAuthenticated:s.isAuthenticated,isLoading:s.isLoading,loading:s.loading,signIn:async e=>{const i=await s.signIn(e);return i&&n.onSignInUrl&&await t.navigateTo(n.onSignInUrl),i},signUp:async t=>await s.signUp({email:t.email,password:"",firstName:"",lastName:""}),signOut:async()=>{await s.signOut(),n.onSignOutUrl&&await t.navigateTo(n.onSignOutUrl)},refreshToken:s.refreshToken,updateProfile:s.updateProfile,setAuthData:s.setAuthData,initialize:async()=>{try{await s.initialize()}catch(t){}}}};exports.useAuthState=()=>{const{isAuthenticated:t,isLoading:e}=n();return{isAuthenticated:t,isLoading:e}},exports.useAuthUser=()=>{const{user:t}=n();return{user:t}},exports.useStrandsAuth=n;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("nuxt/app"),e=require("../../../useStrandsAuth-CTlaiFqK.cjs"),n=()=>{const n=t.useRuntimeConfig().public.strandsAuth,s=e.useStrandsAuth();return{user:s.user,currentUser:s.currentUser,currentSession:s.currentSession,isAuthenticated:s.isAuthenticated,isLoading:s.isLoading,loading:s.loading,signIn:async e=>{const i=await s.signIn(e);return i&&n.onSignInUrl&&await t.navigateTo(n.onSignInUrl),i},signUp:async t=>await s.signUp({email:t.email,password:"",firstName:"",lastName:""}),signOut:async()=>{await s.signOut(),n.onSignOutUrl&&await t.navigateTo(n.onSignOutUrl)},refreshToken:s.refreshToken,updateProfile:s.updateProfile,setAuthData:s.setAuthData,getAuthHeaders:s.getAuthHeaders,initialize:async()=>{try{await s.initialize()}catch(t){}}}};exports.useAuthState=()=>{const{isAuthenticated:t,isLoading:e}=n();return{isAuthenticated:t,isLoading:e}},exports.useAuthUser=()=>{const{user:t}=n();return{user:t}},exports.useStrandsAuth=n;
@@ -1 +1 @@
1
- {"version":3,"file":"useStrandsAuth.cjs.js","sources":["../../../../../../apps/accounts-ui/src/nuxt-v4/runtime/composables/useStrandsAuth.ts"],"sourcesContent":["import type { Ref, ComputedRef } from 'vue'\nimport { readonly } from 'vue'\nimport { useRuntimeConfig } from 'nuxt/app'\nimport { navigateTo } from 'nuxt/app'\nimport { useStrandsAuth as useVueStrandsAuth } from '../../../vue/composables/useStrandsAuth'\nimport type { StrandsAuthConfig } from '../../../types'\nimport type { User, Session, SignInCredentials, SignUpData, AuthResponse } from '../../../types'\n\ninterface StrandsAuthReturn {\n user: ComputedRef<User | null>\n currentUser: ComputedRef<User | null>\n currentSession: ComputedRef<Session | null>\n isAuthenticated: ComputedRef<boolean>\n isLoading: ComputedRef<boolean>\n loading: ComputedRef<boolean>\n signIn: (credentials: SignInCredentials) => Promise<AuthResponse | void>\n signUp: (userData: SignUpData) => Promise<AuthResponse | void>\n signOut: () => Promise<void>\n refreshToken: () => Promise<boolean>\n updateProfile: (profileData: Partial<User>) => Promise<User | null>\n setAuthData: (authResponse: AuthResponse) => void\n initialize: () => Promise<void>\n}\n\nexport const useStrandsAuth = (): StrandsAuthReturn => {\n const config = useRuntimeConfig().public['strandsAuth'] as StrandsAuthConfig\n \n // Get the base Vue composable\n const vueAuth = useVueStrandsAuth()\n\n // Initialize function for setup\n const initialize = async () => {\n try {\n await vueAuth.initialize()\n } catch (error) {\n console.warn('[Strands Auth v4] Initialize failed:', error)\n }\n }\n\n // Enhanced signIn with Nuxt navigation\n const signIn = async (credentials: { email: string; password: string }) => {\n const result = await vueAuth.signIn(credentials)\n \n // Navigate to configured sign-in URL on success\n if (result && config.onSignInUrl) {\n await navigateTo(config.onSignInUrl)\n }\n \n return result\n }\n\n // Enhanced signUp with Nuxt navigation (magic link flow)\n const signUp = async (userData: { email: string }) => {\n // For magic link flow, we just need an email\n const result = await vueAuth.signUp({\n email: userData.email,\n password: '', // Empty password for magic link\n firstName: '', // Will be filled later in the magic link flow\n lastName: ''\n })\n \n // For magic link, we don't navigate immediately\n // The user will complete signup via the magic link\n \n return result\n }\n\n // Enhanced signOut with Nuxt navigation\n const signOut = async () => {\n await vueAuth.signOut()\n \n // Navigate to configured sign-out URL\n if (config.onSignOutUrl) {\n await navigateTo(config.onSignOutUrl)\n }\n }\n\n return {\n // Re-export Vue composable state and methods with explicit typing\n user: vueAuth.user as ComputedRef<User | null>,\n currentUser: vueAuth.currentUser as ComputedRef<User | null>,\n currentSession: vueAuth.currentSession,\n isAuthenticated: vueAuth.isAuthenticated,\n isLoading: vueAuth.isLoading,\n loading: vueAuth.loading,\n\n // Methods with Nuxt-specific navigation overrides\n signIn,\n signUp,\n signOut,\n \n // Other methods from Vue composable\n refreshToken: vueAuth.refreshToken,\n updateProfile: vueAuth.updateProfile,\n setAuthData: vueAuth.setAuthData,\n \n // Initialize function\n initialize,\n }\n}\n\n// Convenience composables \nexport const useAuthUser = (): { user: ComputedRef<User | null> } => {\n const { user } = useStrandsAuth()\n return { user }\n}\n\nexport const useAuthState = (): { isAuthenticated: ComputedRef<boolean>, isLoading: ComputedRef<boolean> } => {\n const { isAuthenticated, isLoading } = useStrandsAuth()\n return { isAuthenticated, isLoading }\n}\n"],"names":["useStrandsAuth","config","useRuntimeConfig","public","vueAuth","useVueStrandsAuth","user","currentUser","currentSession","isAuthenticated","isLoading","loading","signIn","async","credentials","result","onSignInUrl","navigateTo","signUp","userData","email","password","firstName","lastName","signOut","onSignOutUrl","refreshToken","updateProfile","setAuthData","initialize","error"],"mappings":"8JAwBaA,EAAiB,KAC5B,MAAMC,EAASC,EAAAA,mBAAmBC,OAAoB,YAGhDC,EAAUC,EAAAA,iBAiDhB,MAAO,CAELC,KAAMF,EAAQE,KACdC,YAAaH,EAAQG,YACrBC,eAAgBJ,EAAQI,eACxBC,gBAAiBL,EAAQK,gBACzBC,UAAWN,EAAQM,UACnBC,QAASP,EAAQO,QAGjBC,OA/CaC,MAAOC,IACpB,MAAMC,QAAeX,EAAQQ,OAAOE,GAOpC,OAJIC,GAAUd,EAAOe,mBACbC,EAAAA,WAAWhB,EAAOe,aAGnBD,GAwCPG,OApCaL,MAAOM,SAECf,EAAQc,OAAO,CAClCE,MAAOD,EAASC,MAChBC,SAAU,GACVC,UAAW,GACXC,SAAU,KA+BZC,QArBcX,gBACRT,EAAQoB,UAGVvB,EAAOwB,oBACHR,EAAAA,WAAWhB,EAAOwB,eAmB1BC,aAActB,EAAQsB,aACtBC,cAAevB,EAAQuB,cACvBC,YAAaxB,EAAQwB,YAGrBC,WAlEiBhB,UACjB,UACQT,EAAQyB,YAChB,OAASC,GAET,0BAuEwB,KAC1B,MAAMrB,gBAAEA,EAAAC,UAAiBA,GAAcV,IACvC,MAAO,CAAES,kBAAiBC,kCAPD,KACzB,MAAMJ,KAAEA,GAASN,IACjB,MAAO,CAAEM"}
1
+ {"version":3,"file":"useStrandsAuth.cjs.js","sources":["../../../../../../apps/accounts-ui/src/nuxt-v4/runtime/composables/useStrandsAuth.ts"],"sourcesContent":["import type { Ref, ComputedRef } from 'vue'\nimport { readonly } from 'vue'\nimport { useRuntimeConfig } from 'nuxt/app'\nimport { navigateTo } from 'nuxt/app'\nimport { useStrandsAuth as useVueStrandsAuth } from '../../../vue/composables/useStrandsAuth'\nimport type { StrandsAuthConfig } from '../../../types'\nimport type { User, Session, SignInCredentials, SignUpData, AuthResponse } from '../../../types'\n\ninterface StrandsAuthReturn {\n user: ComputedRef<User | null>\n currentUser: ComputedRef<User | null>\n currentSession: ComputedRef<Session | null>\n isAuthenticated: ComputedRef<boolean>\n isLoading: ComputedRef<boolean>\n loading: ComputedRef<boolean>\n signIn: (credentials: SignInCredentials) => Promise<AuthResponse | void>\n signUp: (userData: SignUpData) => Promise<AuthResponse | void>\n signOut: () => Promise<void>\n refreshToken: () => Promise<boolean>\n updateProfile: (profileData: Partial<User>) => Promise<User | null>\n setAuthData: (authResponse: AuthResponse) => void\n getAuthHeaders: () => Record<string, string>\n initialize: () => Promise<void>\n}\n\nexport const useStrandsAuth = (): StrandsAuthReturn => {\n const config = useRuntimeConfig().public['strandsAuth'] as StrandsAuthConfig\n \n // Get the base Vue composable\n const vueAuth = useVueStrandsAuth()\n\n // Initialize function for setup\n const initialize = async () => {\n try {\n await vueAuth.initialize()\n } catch (error) {\n console.warn('[Strands Auth v4] Initialize failed:', error)\n }\n }\n\n // Enhanced signIn with Nuxt navigation\n const signIn = async (credentials: { email: string; password: string }) => {\n const result = await vueAuth.signIn(credentials)\n \n // Navigate to configured sign-in URL on success\n if (result && config.onSignInUrl) {\n await navigateTo(config.onSignInUrl)\n }\n \n return result\n }\n\n // Enhanced signUp with Nuxt navigation (magic link flow)\n const signUp = async (userData: { email: string }) => {\n // For magic link flow, we just need an email\n const result = await vueAuth.signUp({\n email: userData.email,\n password: '', // Empty password for magic link\n firstName: '', // Will be filled later in the magic link flow\n lastName: ''\n })\n \n // For magic link, we don't navigate immediately\n // The user will complete signup via the magic link\n \n return result\n }\n\n // Enhanced signOut with Nuxt navigation\n const signOut = async () => {\n await vueAuth.signOut()\n \n // Navigate to configured sign-out URL\n if (config.onSignOutUrl) {\n await navigateTo(config.onSignOutUrl)\n }\n }\n\n return {\n // Re-export Vue composable state and methods with explicit typing\n user: vueAuth.user as ComputedRef<User | null>,\n currentUser: vueAuth.currentUser as ComputedRef<User | null>,\n currentSession: vueAuth.currentSession,\n isAuthenticated: vueAuth.isAuthenticated,\n isLoading: vueAuth.isLoading,\n loading: vueAuth.loading,\n\n // Methods with Nuxt-specific navigation overrides\n signIn,\n signUp,\n signOut,\n \n // Other methods from Vue composable\n refreshToken: vueAuth.refreshToken,\n updateProfile: vueAuth.updateProfile,\n setAuthData: vueAuth.setAuthData,\n getAuthHeaders: vueAuth.getAuthHeaders,\n \n // Initialize function\n initialize,\n }\n}\n\n// Convenience composables \nexport const useAuthUser = (): { user: ComputedRef<User | null> } => {\n const { user } = useStrandsAuth()\n return { user }\n}\n\nexport const useAuthState = (): { isAuthenticated: ComputedRef<boolean>, isLoading: ComputedRef<boolean> } => {\n const { isAuthenticated, isLoading } = useStrandsAuth()\n return { isAuthenticated, isLoading }\n}\n"],"names":["useStrandsAuth","config","useRuntimeConfig","public","vueAuth","useVueStrandsAuth","user","currentUser","currentSession","isAuthenticated","isLoading","loading","signIn","async","credentials","result","onSignInUrl","navigateTo","signUp","userData","email","password","firstName","lastName","signOut","onSignOutUrl","refreshToken","updateProfile","setAuthData","getAuthHeaders","initialize","error"],"mappings":"8JAyBaA,EAAiB,KAC5B,MAAMC,EAASC,EAAAA,mBAAmBC,OAAoB,YAGhDC,EAAUC,EAAAA,iBAiDhB,MAAO,CAELC,KAAMF,EAAQE,KACdC,YAAaH,EAAQG,YACrBC,eAAgBJ,EAAQI,eACxBC,gBAAiBL,EAAQK,gBACzBC,UAAWN,EAAQM,UACnBC,QAASP,EAAQO,QAGjBC,OA/CaC,MAAOC,IACpB,MAAMC,QAAeX,EAAQQ,OAAOE,GAOpC,OAJIC,GAAUd,EAAOe,mBACbC,EAAAA,WAAWhB,EAAOe,aAGnBD,GAwCPG,OApCaL,MAAOM,SAECf,EAAQc,OAAO,CAClCE,MAAOD,EAASC,MAChBC,SAAU,GACVC,UAAW,GACXC,SAAU,KA+BZC,QArBcX,gBACRT,EAAQoB,UAGVvB,EAAOwB,oBACHR,EAAAA,WAAWhB,EAAOwB,eAmB1BC,aAActB,EAAQsB,aACtBC,cAAevB,EAAQuB,cACvBC,YAAaxB,EAAQwB,YACrBC,eAAgBzB,EAAQyB,eAGxBC,WAnEiBjB,UACjB,UACQT,EAAQ0B,YAChB,OAASC,GAET,0BAwEwB,KAC1B,MAAMtB,gBAAEA,EAAAC,UAAiBA,GAAcV,IACvC,MAAO,CAAES,kBAAiBC,kCAPD,KACzB,MAAMJ,KAAEA,GAASN,IACjB,MAAO,CAAEM"}
@@ -0,0 +1,28 @@
1
+ import { ComputedRef } from 'vue';
2
+ import { User, Session, SignInCredentials, SignUpData, AuthResponse } from '../../../types';
3
+ interface StrandsAuthReturn {
4
+ user: ComputedRef<User | null>;
5
+ currentUser: ComputedRef<User | null>;
6
+ currentSession: ComputedRef<Session | null>;
7
+ isAuthenticated: ComputedRef<boolean>;
8
+ isLoading: ComputedRef<boolean>;
9
+ loading: ComputedRef<boolean>;
10
+ signIn: (credentials: SignInCredentials) => Promise<AuthResponse | void>;
11
+ signUp: (userData: SignUpData) => Promise<AuthResponse | void>;
12
+ signOut: () => Promise<void>;
13
+ refreshToken: () => Promise<boolean>;
14
+ updateProfile: (profileData: Partial<User>) => Promise<User | null>;
15
+ setAuthData: (authResponse: AuthResponse) => void;
16
+ getAuthHeaders: () => Record<string, string>;
17
+ initialize: () => Promise<void>;
18
+ }
19
+ export declare const useStrandsAuth: () => StrandsAuthReturn;
20
+ export declare const useAuthUser: () => {
21
+ user: ComputedRef<User | null>;
22
+ };
23
+ export declare const useAuthState: () => {
24
+ isAuthenticated: ComputedRef<boolean>;
25
+ isLoading: ComputedRef<boolean>;
26
+ };
27
+ export {};
28
+ //# sourceMappingURL=useStrandsAuth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useStrandsAuth.d.ts","sourceRoot":"","sources":["../../../../../../apps/accounts-ui/src/nuxt-v4/runtime/composables/useStrandsAuth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAO,WAAW,EAAE,MAAM,KAAK,CAAA;AAM3C,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAEhG,UAAU,iBAAiB;IACzB,IAAI,EAAE,WAAW,CAAC,IAAI,GAAG,IAAI,CAAC,CAAA;IAC9B,WAAW,EAAE,WAAW,CAAC,IAAI,GAAG,IAAI,CAAC,CAAA;IACrC,cAAc,EAAE,WAAW,CAAC,OAAO,GAAG,IAAI,CAAC,CAAA;IAC3C,eAAe,EAAE,WAAW,CAAC,OAAO,CAAC,CAAA;IACrC,SAAS,EAAE,WAAW,CAAC,OAAO,CAAC,CAAA;IAC/B,OAAO,EAAE,WAAW,CAAC,OAAO,CAAC,CAAA;IAC7B,MAAM,EAAE,CAAC,WAAW,EAAE,iBAAiB,KAAK,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAAA;IACxE,MAAM,EAAE,CAAC,QAAQ,EAAE,UAAU,KAAK,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAAA;IAC9D,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;IAC5B,YAAY,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAA;IACpC,aAAa,EAAE,CAAC,WAAW,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,CAAA;IACnE,WAAW,EAAE,CAAC,YAAY,EAAE,YAAY,KAAK,IAAI,CAAA;IACjD,cAAc,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC5C,UAAU,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CAChC;AAED,eAAO,MAAM,cAAc,QAAO,iBA4EjC,CAAA;AAGD,eAAO,MAAM,WAAW,QAAO;IAAE,IAAI,EAAE,WAAW,CAAC,IAAI,GAAG,IAAI,CAAC,CAAA;CAG9D,CAAA;AAED,eAAO,MAAM,YAAY,QAAO;IAAE,eAAe,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAAC,SAAS,EAAE,WAAW,CAAC,OAAO,CAAC,CAAA;CAGvG,CAAA"}
@@ -50,6 +50,7 @@ const useStrandsAuth = () => {
50
50
  refreshToken: vueAuth.refreshToken,
51
51
  updateProfile: vueAuth.updateProfile,
52
52
  setAuthData: vueAuth.setAuthData,
53
+ getAuthHeaders: vueAuth.getAuthHeaders,
53
54
  // Initialize function
54
55
  initialize
55
56
  };
@@ -1 +1 @@
1
- {"version":3,"file":"useStrandsAuth.es.js","sources":["../../../../../../apps/accounts-ui/src/nuxt-v4/runtime/composables/useStrandsAuth.ts"],"sourcesContent":["import type { Ref, ComputedRef } from 'vue'\nimport { readonly } from 'vue'\nimport { useRuntimeConfig } from 'nuxt/app'\nimport { navigateTo } from 'nuxt/app'\nimport { useStrandsAuth as useVueStrandsAuth } from '../../../vue/composables/useStrandsAuth'\nimport type { StrandsAuthConfig } from '../../../types'\nimport type { User, Session, SignInCredentials, SignUpData, AuthResponse } from '../../../types'\n\ninterface StrandsAuthReturn {\n user: ComputedRef<User | null>\n currentUser: ComputedRef<User | null>\n currentSession: ComputedRef<Session | null>\n isAuthenticated: ComputedRef<boolean>\n isLoading: ComputedRef<boolean>\n loading: ComputedRef<boolean>\n signIn: (credentials: SignInCredentials) => Promise<AuthResponse | void>\n signUp: (userData: SignUpData) => Promise<AuthResponse | void>\n signOut: () => Promise<void>\n refreshToken: () => Promise<boolean>\n updateProfile: (profileData: Partial<User>) => Promise<User | null>\n setAuthData: (authResponse: AuthResponse) => void\n initialize: () => Promise<void>\n}\n\nexport const useStrandsAuth = (): StrandsAuthReturn => {\n const config = useRuntimeConfig().public['strandsAuth'] as StrandsAuthConfig\n \n // Get the base Vue composable\n const vueAuth = useVueStrandsAuth()\n\n // Initialize function for setup\n const initialize = async () => {\n try {\n await vueAuth.initialize()\n } catch (error) {\n console.warn('[Strands Auth v4] Initialize failed:', error)\n }\n }\n\n // Enhanced signIn with Nuxt navigation\n const signIn = async (credentials: { email: string; password: string }) => {\n const result = await vueAuth.signIn(credentials)\n \n // Navigate to configured sign-in URL on success\n if (result && config.onSignInUrl) {\n await navigateTo(config.onSignInUrl)\n }\n \n return result\n }\n\n // Enhanced signUp with Nuxt navigation (magic link flow)\n const signUp = async (userData: { email: string }) => {\n // For magic link flow, we just need an email\n const result = await vueAuth.signUp({\n email: userData.email,\n password: '', // Empty password for magic link\n firstName: '', // Will be filled later in the magic link flow\n lastName: ''\n })\n \n // For magic link, we don't navigate immediately\n // The user will complete signup via the magic link\n \n return result\n }\n\n // Enhanced signOut with Nuxt navigation\n const signOut = async () => {\n await vueAuth.signOut()\n \n // Navigate to configured sign-out URL\n if (config.onSignOutUrl) {\n await navigateTo(config.onSignOutUrl)\n }\n }\n\n return {\n // Re-export Vue composable state and methods with explicit typing\n user: vueAuth.user as ComputedRef<User | null>,\n currentUser: vueAuth.currentUser as ComputedRef<User | null>,\n currentSession: vueAuth.currentSession,\n isAuthenticated: vueAuth.isAuthenticated,\n isLoading: vueAuth.isLoading,\n loading: vueAuth.loading,\n\n // Methods with Nuxt-specific navigation overrides\n signIn,\n signUp,\n signOut,\n \n // Other methods from Vue composable\n refreshToken: vueAuth.refreshToken,\n updateProfile: vueAuth.updateProfile,\n setAuthData: vueAuth.setAuthData,\n \n // Initialize function\n initialize,\n }\n}\n\n// Convenience composables \nexport const useAuthUser = (): { user: ComputedRef<User | null> } => {\n const { user } = useStrandsAuth()\n return { user }\n}\n\nexport const useAuthState = (): { isAuthenticated: ComputedRef<boolean>, isLoading: ComputedRef<boolean> } => {\n const { isAuthenticated, isLoading } = useStrandsAuth()\n return { isAuthenticated, isLoading }\n}\n"],"names":["useVueStrandsAuth"],"mappings":";;AAwBO,MAAM,iBAAiB,MAAyB;AACrD,QAAM,SAAS,mBAAmB,OAAO,aAAa;AAGtD,QAAM,UAAUA,iBAAA;AAGhB,QAAM,aAAa,YAAY;AAC7B,QAAI;AACF,YAAM,QAAQ,WAAA;AAAA,IAChB,SAAS,OAAO;AACd,cAAQ,KAAK,wCAAwC,KAAK;AAAA,IAC5D;AAAA,EACF;AAGA,QAAM,SAAS,OAAO,gBAAqD;AACzE,UAAM,SAAS,MAAM,QAAQ,OAAO,WAAW;AAG/C,QAAI,UAAU,OAAO,aAAa;AAChC,YAAM,WAAW,OAAO,WAAW;AAAA,IACrC;AAEA,WAAO;AAAA,EACT;AAGA,QAAM,SAAS,OAAO,aAAgC;AAEpD,UAAM,SAAS,MAAM,QAAQ,OAAO;AAAA,MAClC,OAAO,SAAS;AAAA,MAChB,UAAU;AAAA;AAAA,MACV,WAAW;AAAA;AAAA,MACX,UAAU;AAAA,IAAA,CACX;AAKD,WAAO;AAAA,EACT;AAGA,QAAM,UAAU,YAAY;AAC1B,UAAM,QAAQ,QAAA;AAGd,QAAI,OAAO,cAAc;AACvB,YAAM,WAAW,OAAO,YAAY;AAAA,IACtC;AAAA,EACF;AAEA,SAAO;AAAA;AAAA,IAEL,MAAM,QAAQ;AAAA,IACd,aAAa,QAAQ;AAAA,IACrB,gBAAgB,QAAQ;AAAA,IACxB,iBAAiB,QAAQ;AAAA,IACzB,WAAW,QAAQ;AAAA,IACnB,SAAS,QAAQ;AAAA;AAAA,IAGjB;AAAA,IACA;AAAA,IACA;AAAA;AAAA,IAGA,cAAc,QAAQ;AAAA,IACtB,eAAe,QAAQ;AAAA,IACvB,aAAa,QAAQ;AAAA;AAAA,IAGrB;AAAA,EAAA;AAEJ;AAGO,MAAM,cAAc,MAA0C;AACnE,QAAM,EAAE,KAAA,IAAS,eAAA;AACjB,SAAO,EAAE,KAAA;AACX;AAEO,MAAM,eAAe,MAAkF;AAC5G,QAAM,EAAE,iBAAiB,UAAA,IAAc,eAAA;AACvC,SAAO,EAAE,iBAAiB,UAAA;AAC5B;"}
1
+ {"version":3,"file":"useStrandsAuth.es.js","sources":["../../../../../../apps/accounts-ui/src/nuxt-v4/runtime/composables/useStrandsAuth.ts"],"sourcesContent":["import type { Ref, ComputedRef } from 'vue'\nimport { readonly } from 'vue'\nimport { useRuntimeConfig } from 'nuxt/app'\nimport { navigateTo } from 'nuxt/app'\nimport { useStrandsAuth as useVueStrandsAuth } from '../../../vue/composables/useStrandsAuth'\nimport type { StrandsAuthConfig } from '../../../types'\nimport type { User, Session, SignInCredentials, SignUpData, AuthResponse } from '../../../types'\n\ninterface StrandsAuthReturn {\n user: ComputedRef<User | null>\n currentUser: ComputedRef<User | null>\n currentSession: ComputedRef<Session | null>\n isAuthenticated: ComputedRef<boolean>\n isLoading: ComputedRef<boolean>\n loading: ComputedRef<boolean>\n signIn: (credentials: SignInCredentials) => Promise<AuthResponse | void>\n signUp: (userData: SignUpData) => Promise<AuthResponse | void>\n signOut: () => Promise<void>\n refreshToken: () => Promise<boolean>\n updateProfile: (profileData: Partial<User>) => Promise<User | null>\n setAuthData: (authResponse: AuthResponse) => void\n getAuthHeaders: () => Record<string, string>\n initialize: () => Promise<void>\n}\n\nexport const useStrandsAuth = (): StrandsAuthReturn => {\n const config = useRuntimeConfig().public['strandsAuth'] as StrandsAuthConfig\n \n // Get the base Vue composable\n const vueAuth = useVueStrandsAuth()\n\n // Initialize function for setup\n const initialize = async () => {\n try {\n await vueAuth.initialize()\n } catch (error) {\n console.warn('[Strands Auth v4] Initialize failed:', error)\n }\n }\n\n // Enhanced signIn with Nuxt navigation\n const signIn = async (credentials: { email: string; password: string }) => {\n const result = await vueAuth.signIn(credentials)\n \n // Navigate to configured sign-in URL on success\n if (result && config.onSignInUrl) {\n await navigateTo(config.onSignInUrl)\n }\n \n return result\n }\n\n // Enhanced signUp with Nuxt navigation (magic link flow)\n const signUp = async (userData: { email: string }) => {\n // For magic link flow, we just need an email\n const result = await vueAuth.signUp({\n email: userData.email,\n password: '', // Empty password for magic link\n firstName: '', // Will be filled later in the magic link flow\n lastName: ''\n })\n \n // For magic link, we don't navigate immediately\n // The user will complete signup via the magic link\n \n return result\n }\n\n // Enhanced signOut with Nuxt navigation\n const signOut = async () => {\n await vueAuth.signOut()\n \n // Navigate to configured sign-out URL\n if (config.onSignOutUrl) {\n await navigateTo(config.onSignOutUrl)\n }\n }\n\n return {\n // Re-export Vue composable state and methods with explicit typing\n user: vueAuth.user as ComputedRef<User | null>,\n currentUser: vueAuth.currentUser as ComputedRef<User | null>,\n currentSession: vueAuth.currentSession,\n isAuthenticated: vueAuth.isAuthenticated,\n isLoading: vueAuth.isLoading,\n loading: vueAuth.loading,\n\n // Methods with Nuxt-specific navigation overrides\n signIn,\n signUp,\n signOut,\n \n // Other methods from Vue composable\n refreshToken: vueAuth.refreshToken,\n updateProfile: vueAuth.updateProfile,\n setAuthData: vueAuth.setAuthData,\n getAuthHeaders: vueAuth.getAuthHeaders,\n \n // Initialize function\n initialize,\n }\n}\n\n// Convenience composables \nexport const useAuthUser = (): { user: ComputedRef<User | null> } => {\n const { user } = useStrandsAuth()\n return { user }\n}\n\nexport const useAuthState = (): { isAuthenticated: ComputedRef<boolean>, isLoading: ComputedRef<boolean> } => {\n const { isAuthenticated, isLoading } = useStrandsAuth()\n return { isAuthenticated, isLoading }\n}\n"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e,MAAkF;AAC5G,QAAM,EAAE,iBAAiB,UAAA,IAAc,eAAA;AACvC,SAAO,EAAE,iBAAiB,UAAA;AAC5B;"}
@@ -0,0 +1,4 @@
1
+ import { RouteMiddleware } from 'nuxt/app';
2
+ declare const _default: RouteMiddleware;
3
+ export default _default;
4
+ //# sourceMappingURL=auth.global.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.global.d.ts","sourceRoot":"","sources":["../../../../../../apps/accounts-ui/src/nuxt-v4/runtime/middleware/auth.global.ts"],"names":[],"mappings":";;AAGA,wBAsDE"}
@@ -0,0 +1,4 @@
1
+ import { Plugin, ObjectPlugin } from 'nuxt/app';
2
+ declare const _default: Plugin<Record<string, unknown>> & ObjectPlugin<Record<string, unknown>>;
3
+ export default _default;
4
+ //# sourceMappingURL=plugin.client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.client.d.ts","sourceRoot":"","sources":["../../../../../apps/accounts-ui/src/nuxt-v4/runtime/plugin.client.ts"],"names":[],"mappings":";;AAKA,wBAkCE"}
@@ -0,0 +1,4 @@
1
+ import { Plugin, ObjectPlugin } from 'nuxt/app';
2
+ declare const _default: Plugin<Record<string, unknown>> & ObjectPlugin<Record<string, unknown>>;
3
+ export default _default;
4
+ //# sourceMappingURL=plugin.server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.server.d.ts","sourceRoot":"","sources":["../../../../../apps/accounts-ui/src/nuxt-v4/runtime/plugin.server.ts"],"names":[],"mappings":";;AAIA,wBAsBE"}
@@ -1 +1 @@
1
- {"version":3,"file":"auth-interceptor.client.cjs.js","sources":["../../../../../../apps/accounts-ui/src/nuxt-v4/runtime/plugins/auth-interceptor.client.ts"],"sourcesContent":["import { defineNuxtPlugin } from 'nuxt/app'\n\nexport default defineNuxtPlugin({\n name: 'strands-auth-interceptor',\n setup() {\n // Only run on client side\n if (process.server) return\n\n // Store original fetch function\n const originalFetch = globalThis.fetch\n\n // Create interceptor function\n globalThis.fetch = async (input: RequestInfo | URL, init?: RequestInit): Promise<Response> => {\n try {\n // Import auth composable dynamically to avoid SSR issues\n const { useStrandsAuth } = await import('../composables/useStrandsAuth')\n const { currentSession, getAuthHeaders } = useStrandsAuth()\n\n // Parse request URL to determine if it's an API request that needs auth\n let url: string\n if (typeof input === 'string') {\n url = input\n } else if (input instanceof URL) {\n url = input.toString()\n } else {\n url = input.url\n }\n\n // Check if this is an API request that should include auth headers\n const shouldAddAuth = shouldInjectAuth(url)\n\n if (shouldAddAuth && currentSession.value?.accessToken) {\n // Get auth headers\n try {\n const authHeaders = getAuthHeaders()\n \n // Merge headers with existing headers\n const headers = new Headers(init?.headers)\n Object.entries(authHeaders).forEach(([key, value]) => {\n headers.set(key, value)\n })\n\n // Create new init object with merged headers\n const enhancedInit: RequestInit = {\n ...init,\n headers\n }\n\n console.log('[Strands Auth] Injecting auth headers for request:', url)\n return originalFetch(input, enhancedInit)\n } catch (error) {\n // If we can't get auth headers, continue with original request\n console.warn('[Strands Auth] Failed to inject auth headers:', error)\n }\n }\n\n // Return original request\n return originalFetch(input, init)\n } catch (error) {\n // If anything goes wrong, fallback to original fetch\n console.error('[Strands Auth] Error in fetch interceptor:', error)\n return originalFetch(input, init)\n }\n }\n }\n})\n\n/**\n * Determine if a URL should have auth headers injected\n */\nfunction shouldInjectAuth(url: string): boolean {\n // Skip data URLs, blob URLs, etc.\n if (!url.startsWith('http')) {\n return false\n }\n\n // Skip third-party APIs that shouldn't receive our auth tokens\n const skipDomains = [\n 'googleapis.com',\n 'github.com/api',\n 'api.github.com',\n 'discord.com/api',\n 'graph.microsoft.com',\n 'api.stripe.com',\n 'api.twilio.com',\n // Add other third-party APIs here\n ]\n\n const shouldSkip = skipDomains.some(domain => url.includes(domain))\n if (shouldSkip) {\n return false\n }\n\n // Include auth for any API endpoints that contain common API patterns\n const apiPatterns = [\n '/api/',\n '/v1/',\n '/v2/',\n '/graphql',\n '/trpc',\n ]\n\n const isApiRequest = apiPatterns.some(pattern => url.includes(pattern))\n \n // Also check for common backend ports that might be API servers\n const apiPorts = [':3001', ':8000', ':8080', ':5000', ':4000']\n const hasApiPort = apiPorts.some(port => url.includes(port))\n\n return isApiRequest || hasApiPort\n}"],"names":["authInterceptor_client","name","setup","process","server","originalFetch","globalThis","fetch","async","input","init","useStrandsAuth","Promise","resolve","then","require","currentSession","getAuthHeaders","url","URL","toString","shouldAddAuth","startsWith","shouldSkip","some","includes","domain","isApiRequest","pattern","hasApiPort","port","shouldInjectAuth","value","accessToken","authHeaders","headers","Headers","Object","entries","forEach","key","set","enhancedInit","error"],"mappings":"mBAEAA,uCAAgC,CAC9BC,KAAM,2BACN,KAAAC,GAEE,GAAIC,QAAQC,OAAQ,OAGpB,MAAMC,EAAgBC,WAAWC,MAGjCD,WAAWC,MAAQC,MAAOC,EAA0BC,KAClD,IAEE,MAAMC,eAAEA,SAAyBC,QAAAC,UAAAC,KAAA,IAAAC,QAAO,0CAClCC,eAAEA,EAAAC,eAAgBA,GAAmBN,IAG3C,IAAIO,EAEFA,EADmB,iBAAVT,EACHA,EACGA,aAAiBU,IACpBV,EAAMW,WAENX,EAAMS,IAId,MAAMG,EAyCd,SAA0BH,GAExB,IAAKA,EAAII,WAAW,QAClB,OAAO,EAIT,MAWMC,EAXc,CAClB,iBACA,iBACA,iBACA,kBACA,sBACA,iBACA,kBAI6BC,QAAeN,EAAIO,SAASC,IAC3D,GAAIH,EACF,OAAO,EAIT,MAQMI,EARc,CAClB,QACA,OACA,OACA,WACA,SAG+BH,QAAgBN,EAAIO,SAASG,IAIxDC,EADW,CAAC,QAAS,QAAS,QAAS,QAAS,SAC1BL,QAAaN,EAAIO,SAASK,IAEtD,OAAOH,GAAgBE,CACzB,CAhF8BE,CAAiBb,GAEvC,GAAIG,GAAiBL,EAAegB,OAAOC,YAEzC,IACE,MAAMC,EAAcjB,IAGdkB,EAAU,IAAIC,QAAQ1B,GAAMyB,SAClCE,OAAOC,QAAQJ,GAAaK,QAAQ,EAAEC,EAAKR,MACzCG,EAAQM,IAAID,EAAKR,KAInB,MAAMU,EAA4B,IAC7BhC,EACHyB,WAIF,OAAO9B,EAAcI,EAAOiC,EAC9B,OAASC,GAGT,CAIF,OAAOtC,EAAcI,EAAOC,EAC9B,OAASiC,GAGP,OAAOtC,EAAcI,EAAOC,EAC9B,EAEJ"}
1
+ {"version":3,"file":"auth-interceptor.client.cjs.js","sources":["../../../../../../apps/accounts-ui/src/nuxt-v4/runtime/plugins/auth-interceptor.client.ts"],"sourcesContent":["import { defineNuxtPlugin } from 'nuxt/app'\n\nexport default defineNuxtPlugin({\n name: 'strands-auth-interceptor',\n setup() {\n // Only run on client side\n if (process.server) return\n\n // Store original fetch function\n const originalFetch = globalThis.fetch\n\n // Create interceptor function\n globalThis.fetch = async (input: RequestInfo | URL, init?: RequestInit): Promise<Response> => {\n try {\n // Import auth composable dynamically to avoid SSR issues\n const { useStrandsAuth } = await import('../composables/useStrandsAuth')\n const { currentSession, getAuthHeaders } = useStrandsAuth()\n\n // Parse request URL to determine if it's an API request that needs auth\n let url: string\n if (typeof input === 'string') {\n url = input\n } else if (input instanceof URL) {\n url = input.toString()\n } else {\n url = input.url\n }\n\n // Check if this is an API request that should include auth headers\n const shouldAddAuth = shouldInjectAuth(url)\n\n if (shouldAddAuth && currentSession.value?.accessToken) {\n // Get auth headers\n try {\n const authHeaders = getAuthHeaders()\n \n // Merge headers with existing headers\n const headers = new Headers(init?.headers)\n Object.entries(authHeaders).forEach(([key, value]) => {\n headers.set(key, value as string)\n })\n\n // Create new init object with merged headers\n const enhancedInit: RequestInit = {\n ...init,\n headers\n }\n\n console.log('[Strands Auth] Injecting auth headers for request:', url)\n return originalFetch(input, enhancedInit)\n } catch (error) {\n // If we can't get auth headers, continue with original request\n console.warn('[Strands Auth] Failed to inject auth headers:', error)\n }\n }\n\n // Return original request\n return originalFetch(input, init)\n } catch (error) {\n // If anything goes wrong, fallback to original fetch\n console.error('[Strands Auth] Error in fetch interceptor:', error)\n return originalFetch(input, init)\n }\n }\n }\n})\n\n/**\n * Determine if a URL should have auth headers injected\n */\nfunction shouldInjectAuth(url: string): boolean {\n // Skip data URLs, blob URLs, etc.\n if (!url.startsWith('http')) {\n return false\n }\n\n // Skip third-party APIs that shouldn't receive our auth tokens\n const skipDomains = [\n 'googleapis.com',\n 'github.com/api',\n 'api.github.com',\n 'discord.com/api',\n 'graph.microsoft.com',\n 'api.stripe.com',\n 'api.twilio.com',\n // Add other third-party APIs here\n ]\n\n const shouldSkip = skipDomains.some(domain => url.includes(domain))\n if (shouldSkip) {\n return false\n }\n\n // Include auth for any API endpoints that contain common API patterns\n const apiPatterns = [\n '/api/',\n '/v1/',\n '/v2/',\n '/graphql',\n '/trpc',\n ]\n\n const isApiRequest = apiPatterns.some(pattern => url.includes(pattern))\n \n // Also check for common backend ports that might be API servers\n const apiPorts = [':3001', ':8000', ':8080', ':5000', ':4000']\n const hasApiPort = apiPorts.some(port => url.includes(port))\n\n return isApiRequest || hasApiPort\n}"],"names":["authInterceptor_client","name","setup","process","server","originalFetch","globalThis","fetch","async","input","init","useStrandsAuth","Promise","resolve","then","require","currentSession","getAuthHeaders","url","URL","toString","shouldAddAuth","startsWith","shouldSkip","some","includes","domain","isApiRequest","pattern","hasApiPort","port","shouldInjectAuth","value","accessToken","authHeaders","headers","Headers","Object","entries","forEach","key","set","enhancedInit","error"],"mappings":"mBAEAA,uCAAgC,CAC9BC,KAAM,2BACN,KAAAC,GAEE,GAAIC,QAAQC,OAAQ,OAGpB,MAAMC,EAAgBC,WAAWC,MAGjCD,WAAWC,MAAQC,MAAOC,EAA0BC,KAClD,IAEE,MAAMC,eAAEA,SAAyBC,QAAAC,UAAAC,KAAA,IAAAC,QAAO,0CAClCC,eAAEA,EAAAC,eAAgBA,GAAmBN,IAG3C,IAAIO,EAEFA,EADmB,iBAAVT,EACHA,EACGA,aAAiBU,IACpBV,EAAMW,WAENX,EAAMS,IAId,MAAMG,EAyCd,SAA0BH,GAExB,IAAKA,EAAII,WAAW,QAClB,OAAO,EAIT,MAWMC,EAXc,CAClB,iBACA,iBACA,iBACA,kBACA,sBACA,iBACA,kBAI6BC,QAAeN,EAAIO,SAASC,IAC3D,GAAIH,EACF,OAAO,EAIT,MAQMI,EARc,CAClB,QACA,OACA,OACA,WACA,SAG+BH,QAAgBN,EAAIO,SAASG,IAIxDC,EADW,CAAC,QAAS,QAAS,QAAS,QAAS,SAC1BL,QAAaN,EAAIO,SAASK,IAEtD,OAAOH,GAAgBE,CACzB,CAhF8BE,CAAiBb,GAEvC,GAAIG,GAAiBL,EAAegB,OAAOC,YAEzC,IACE,MAAMC,EAAcjB,IAGdkB,EAAU,IAAIC,QAAQ1B,GAAMyB,SAClCE,OAAOC,QAAQJ,GAAaK,QAAQ,EAAEC,EAAKR,MACzCG,EAAQM,IAAID,EAAKR,KAInB,MAAMU,EAA4B,IAC7BhC,EACHyB,WAIF,OAAO9B,EAAcI,EAAOiC,EAC9B,OAASC,GAGT,CAIF,OAAOtC,EAAcI,EAAOC,EAC9B,OAASiC,GAGP,OAAOtC,EAAcI,EAAOC,EAC9B,EAEJ"}
@@ -0,0 +1,4 @@
1
+ import { Plugin, ObjectPlugin } from 'nuxt/app';
2
+ declare const _default: Plugin<Record<string, unknown>> & ObjectPlugin<Record<string, unknown>>;
3
+ export default _default;
4
+ //# sourceMappingURL=auth-interceptor.client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth-interceptor.client.d.ts","sourceRoot":"","sources":["../../../../../../apps/accounts-ui/src/nuxt-v4/runtime/plugins/auth-interceptor.client.ts"],"names":[],"mappings":";;AAEA,wBA+DE"}
@@ -1 +1 @@
1
- {"version":3,"file":"auth-interceptor.client.es.js","sources":["../../../../../../apps/accounts-ui/src/nuxt-v4/runtime/plugins/auth-interceptor.client.ts"],"sourcesContent":["import { defineNuxtPlugin } from 'nuxt/app'\n\nexport default defineNuxtPlugin({\n name: 'strands-auth-interceptor',\n setup() {\n // Only run on client side\n if (process.server) return\n\n // Store original fetch function\n const originalFetch = globalThis.fetch\n\n // Create interceptor function\n globalThis.fetch = async (input: RequestInfo | URL, init?: RequestInit): Promise<Response> => {\n try {\n // Import auth composable dynamically to avoid SSR issues\n const { useStrandsAuth } = await import('../composables/useStrandsAuth')\n const { currentSession, getAuthHeaders } = useStrandsAuth()\n\n // Parse request URL to determine if it's an API request that needs auth\n let url: string\n if (typeof input === 'string') {\n url = input\n } else if (input instanceof URL) {\n url = input.toString()\n } else {\n url = input.url\n }\n\n // Check if this is an API request that should include auth headers\n const shouldAddAuth = shouldInjectAuth(url)\n\n if (shouldAddAuth && currentSession.value?.accessToken) {\n // Get auth headers\n try {\n const authHeaders = getAuthHeaders()\n \n // Merge headers with existing headers\n const headers = new Headers(init?.headers)\n Object.entries(authHeaders).forEach(([key, value]) => {\n headers.set(key, value)\n })\n\n // Create new init object with merged headers\n const enhancedInit: RequestInit = {\n ...init,\n headers\n }\n\n console.log('[Strands Auth] Injecting auth headers for request:', url)\n return originalFetch(input, enhancedInit)\n } catch (error) {\n // If we can't get auth headers, continue with original request\n console.warn('[Strands Auth] Failed to inject auth headers:', error)\n }\n }\n\n // Return original request\n return originalFetch(input, init)\n } catch (error) {\n // If anything goes wrong, fallback to original fetch\n console.error('[Strands Auth] Error in fetch interceptor:', error)\n return originalFetch(input, init)\n }\n }\n }\n})\n\n/**\n * Determine if a URL should have auth headers injected\n */\nfunction shouldInjectAuth(url: string): boolean {\n // Skip data URLs, blob URLs, etc.\n if (!url.startsWith('http')) {\n return false\n }\n\n // Skip third-party APIs that shouldn't receive our auth tokens\n const skipDomains = [\n 'googleapis.com',\n 'github.com/api',\n 'api.github.com',\n 'discord.com/api',\n 'graph.microsoft.com',\n 'api.stripe.com',\n 'api.twilio.com',\n // Add other third-party APIs here\n ]\n\n const shouldSkip = skipDomains.some(domain => url.includes(domain))\n if (shouldSkip) {\n return false\n }\n\n // Include auth for any API endpoints that contain common API patterns\n const apiPatterns = [\n '/api/',\n '/v1/',\n '/v2/',\n '/graphql',\n '/trpc',\n ]\n\n const isApiRequest = apiPatterns.some(pattern => url.includes(pattern))\n \n // Also check for common backend ports that might be API servers\n const apiPorts = [':3001', ':8000', ':8080', ':5000', ':4000']\n const hasApiPort = apiPorts.some(port => url.includes(port))\n\n return isApiRequest || hasApiPort\n}"],"names":[],"mappings":";AAEA,MAAA,yBAAe,iBAAiB;AAAA,EAC9B,MAAM;AAAA,EACN,QAAQ;AAEN,QAAI,QAAQ,OAAQ;AAGpB,UAAM,gBAAgB,WAAW;AAGjC,eAAW,QAAQ,OAAO,OAA0B,SAA0C;AAC5F,UAAI;AAEF,cAAM,EAAE,eAAA,IAAmB,MAAM,OAAO,qCAA+B;AACvE,cAAM,EAAE,gBAAgB,eAAA,IAAmB,eAAA;AAG3C,YAAI;AACJ,YAAI,OAAO,UAAU,UAAU;AAC7B,gBAAM;AAAA,QACR,WAAW,iBAAiB,KAAK;AAC/B,gBAAM,MAAM,SAAA;AAAA,QACd,OAAO;AACL,gBAAM,MAAM;AAAA,QACd;AAGA,cAAM,gBAAgB,iBAAiB,GAAG;AAE1C,YAAI,iBAAiB,eAAe,OAAO,aAAa;AAEtD,cAAI;AACF,kBAAM,cAAc,eAAA;AAGpB,kBAAM,UAAU,IAAI,QAAQ,MAAM,OAAO;AACzC,mBAAO,QAAQ,WAAW,EAAE,QAAQ,CAAC,CAAC,KAAK,KAAK,MAAM;AACpD,sBAAQ,IAAI,KAAK,KAAK;AAAA,YACxB,CAAC;AAGD,kBAAM,eAA4B;AAAA,cAChC,GAAG;AAAA,cACH;AAAA,YAAA;AAGF,oBAAQ,IAAI,sDAAsD,GAAG;AACrE,mBAAO,cAAc,OAAO,YAAY;AAAA,UAC1C,SAAS,OAAO;AAEd,oBAAQ,KAAK,iDAAiD,KAAK;AAAA,UACrE;AAAA,QACF;AAGA,eAAO,cAAc,OAAO,IAAI;AAAA,MAClC,SAAS,OAAO;AAEd,gBAAQ,MAAM,8CAA8C,KAAK;AACjE,eAAO,cAAc,OAAO,IAAI;AAAA,MAClC;AAAA,IACF;AAAA,EACF;AACF,CAAC;AAKD,SAAS,iBAAiB,KAAsB;AAE9C,MAAI,CAAC,IAAI,WAAW,MAAM,GAAG;AAC3B,WAAO;AAAA,EACT;AAGA,QAAM,cAAc;AAAA,IAClB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAAA,EAAA;AAIF,QAAM,aAAa,YAAY,KAAK,YAAU,IAAI,SAAS,MAAM,CAAC;AAClE,MAAI,YAAY;AACd,WAAO;AAAA,EACT;AAGA,QAAM,cAAc;AAAA,IAClB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA;AAGF,QAAM,eAAe,YAAY,KAAK,aAAW,IAAI,SAAS,OAAO,CAAC;AAGtE,QAAM,WAAW,CAAC,SAAS,SAAS,SAAS,SAAS,OAAO;AAC7D,QAAM,aAAa,SAAS,KAAK,UAAQ,IAAI,SAAS,IAAI,CAAC;AAE3D,SAAO,gBAAgB;AACzB;"}
1
+ {"version":3,"file":"auth-interceptor.client.es.js","sources":["../../../../../../apps/accounts-ui/src/nuxt-v4/runtime/plugins/auth-interceptor.client.ts"],"sourcesContent":["import { defineNuxtPlugin } from 'nuxt/app'\n\nexport default defineNuxtPlugin({\n name: 'strands-auth-interceptor',\n setup() {\n // Only run on client side\n if (process.server) return\n\n // Store original fetch function\n const originalFetch = globalThis.fetch\n\n // Create interceptor function\n globalThis.fetch = async (input: RequestInfo | URL, init?: RequestInit): Promise<Response> => {\n try {\n // Import auth composable dynamically to avoid SSR issues\n const { useStrandsAuth } = await import('../composables/useStrandsAuth')\n const { currentSession, getAuthHeaders } = useStrandsAuth()\n\n // Parse request URL to determine if it's an API request that needs auth\n let url: string\n if (typeof input === 'string') {\n url = input\n } else if (input instanceof URL) {\n url = input.toString()\n } else {\n url = input.url\n }\n\n // Check if this is an API request that should include auth headers\n const shouldAddAuth = shouldInjectAuth(url)\n\n if (shouldAddAuth && currentSession.value?.accessToken) {\n // Get auth headers\n try {\n const authHeaders = getAuthHeaders()\n \n // Merge headers with existing headers\n const headers = new Headers(init?.headers)\n Object.entries(authHeaders).forEach(([key, value]) => {\n headers.set(key, value as string)\n })\n\n // Create new init object with merged headers\n const enhancedInit: RequestInit = {\n ...init,\n headers\n }\n\n console.log('[Strands Auth] Injecting auth headers for request:', url)\n return originalFetch(input, enhancedInit)\n } catch (error) {\n // If we can't get auth headers, continue with original request\n console.warn('[Strands Auth] Failed to inject auth headers:', error)\n }\n }\n\n // Return original request\n return originalFetch(input, init)\n } catch (error) {\n // If anything goes wrong, fallback to original fetch\n console.error('[Strands Auth] Error in fetch interceptor:', error)\n return originalFetch(input, init)\n }\n }\n }\n})\n\n/**\n * Determine if a URL should have auth headers injected\n */\nfunction shouldInjectAuth(url: string): boolean {\n // Skip data URLs, blob URLs, etc.\n if (!url.startsWith('http')) {\n return false\n }\n\n // Skip third-party APIs that shouldn't receive our auth tokens\n const skipDomains = [\n 'googleapis.com',\n 'github.com/api',\n 'api.github.com',\n 'discord.com/api',\n 'graph.microsoft.com',\n 'api.stripe.com',\n 'api.twilio.com',\n // Add other third-party APIs here\n ]\n\n const shouldSkip = skipDomains.some(domain => url.includes(domain))\n if (shouldSkip) {\n return false\n }\n\n // Include auth for any API endpoints that contain common API patterns\n const apiPatterns = [\n '/api/',\n '/v1/',\n '/v2/',\n '/graphql',\n '/trpc',\n ]\n\n const isApiRequest = apiPatterns.some(pattern => url.includes(pattern))\n \n // Also check for common backend ports that might be API servers\n const apiPorts = [':3001', ':8000', ':8080', ':5000', ':4000']\n const hasApiPort = apiPorts.some(port => url.includes(port))\n\n return isApiRequest || hasApiPort\n}"],"names":[],"mappings":";AAEA,MAAA,yBAAe,iBAAiB;AAAA,EAC9B,MAAM;AAAA,EACN,QAAQ;AAEN,QAAI,QAAQ,OAAQ;AAGpB,UAAM,gBAAgB,WAAW;AAGjC,eAAW,QAAQ,OAAO,OAA0B,SA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EACT;AAGA,QAAM,cAAc;AAAA,IAClB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA;AAGF,QAAM,eAAe,YAAY,KAAK,aAAW,IAAI,SAAS,OAAO,CAAC;AAGtE,QAAM,WAAW,CAAC,SAAS,SAAS,SAAS,SAAS,OAAO;AAC7D,QAAM,aAAa,SAAS,KAAK,UAAQ,IAAI,SAAS,IAAI,CAAC;AAE3D,SAAO,gBAAgB;AACzB;"}
@@ -0,0 +1,64 @@
1
+ export interface StrandsUser {
2
+ id: string;
3
+ email: string;
4
+ firstName: string;
5
+ lastName: string;
6
+ avatar?: string;
7
+ mfaEnabled: boolean;
8
+ emailVerified: boolean;
9
+ createdAt: string | Date;
10
+ updatedAt: string | Date;
11
+ }
12
+ export interface StrandsSession {
13
+ accessToken: string;
14
+ refreshToken: string;
15
+ expiresAt: Date;
16
+ user: StrandsUser;
17
+ }
18
+ interface StrandsAuthRuntimeConfig {
19
+ baseUrl?: string;
20
+ applicationId?: string;
21
+ publicKey?: string;
22
+ accentColor?: string;
23
+ redirectUrl?: string;
24
+ onSignInUrl?: string;
25
+ onSignOutUrl?: string;
26
+ /** @deprecated OAuth providers are now dynamically fetched from API */
27
+ oauthProviders?: string[];
28
+ autoRefresh?: boolean;
29
+ refreshInterval?: number;
30
+ protectedRoutes?: string[];
31
+ guestOnlyRoutes?: string[];
32
+ devMode?: boolean;
33
+ }
34
+ declare module '@nuxt/schema' {
35
+ interface PublicRuntimeConfig {
36
+ strandsAuth?: StrandsAuthRuntimeConfig;
37
+ }
38
+ interface NuxtConfig {
39
+ strandsAuth?: import('../types').StrandsAuthConfig;
40
+ }
41
+ interface NuxtOptions {
42
+ strandsAuth?: import('../types').StrandsAuthConfig;
43
+ }
44
+ }
45
+ declare module 'nuxt/schema' {
46
+ interface PublicRuntimeConfig {
47
+ strandsAuth?: StrandsAuthRuntimeConfig;
48
+ }
49
+ interface NuxtConfig {
50
+ strandsAuth?: import('../types').StrandsAuthConfig;
51
+ }
52
+ interface NuxtOptions {
53
+ strandsAuth?: import('../types').StrandsAuthConfig;
54
+ }
55
+ }
56
+ declare module 'nuxt/app' {
57
+ interface NuxtApp {
58
+ $strandsAuth: {
59
+ accentColor: string;
60
+ };
61
+ }
62
+ }
63
+ export {};
64
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../apps/accounts-ui/src/nuxt-v4/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,UAAU,EAAE,OAAO,CAAA;IACnB,aAAa,EAAE,OAAO,CAAA;IACtB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;CACzB;AAED,MAAM,WAAW,cAAc;IAC7B,WAAW,EAAE,MAAM,CAAA;IACnB,YAAY,EAAE,MAAM,CAAA;IACpB,SAAS,EAAE,IAAI,CAAA;IACf,IAAI,EAAE,WAAW,CAAA;CAClB;AAGD,UAAU,wBAAwB;IAChC,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,uEAAuE;IACvE,cAAc,CAAC,EAAE,MAAM,EAAE,CAAA;IACzB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAA;IAC1B,eAAe,CAAC,EAAE,MAAM,EAAE,CAAA;IAC1B,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAGD,OAAO,QAAQ,cAAc,CAAC;IAC5B,UAAU,mBAAmB;QAC3B,WAAW,CAAC,EAAE,wBAAwB,CAAA;KACvC;IACD,UAAU,UAAU;QAClB,WAAW,CAAC,EAAE,OAAO,UAAU,EAAE,iBAAiB,CAAA;KACnD;IACD,UAAU,WAAW;QACnB,WAAW,CAAC,EAAE,OAAO,UAAU,EAAE,iBAAiB,CAAA;KACnD;CACF;AAGD,OAAO,QAAQ,aAAa,CAAC;IAC3B,UAAU,mBAAmB;QAC3B,WAAW,CAAC,EAAE,wBAAwB,CAAA;KACvC;IACD,UAAU,UAAU;QAClB,WAAW,CAAC,EAAE,OAAO,UAAU,EAAE,iBAAiB,CAAA;KACnD;IACD,UAAU,WAAW;QACnB,WAAW,CAAC,EAAE,OAAO,UAAU,EAAE,iBAAiB,CAAA;KACnD;CACF;AAGD,OAAO,QAAQ,UAAU,CAAC;IACxB,UAAU,OAAO;QACf,YAAY,EAAE;YACZ,WAAW,EAAE,MAAM,CAAA;SACpB,CAAA;KACF;CACF;AAED,OAAO,EAAE,CAAA"}
@@ -0,0 +1,5 @@
1
+ export { default } from './nuxt-v4/module';
2
+ export type { StrandsAuthConfig, StrandsAuthEndpoints } from './types';
3
+ export { useStrandsAuth, useAuthUser, useAuthState } from './nuxt-v4/runtime/composables/useStrandsAuth';
4
+ export { useAuthenticatedFetch, $authFetch } from './nuxt-v4/runtime/composables/useAuthenticatedFetch';
5
+ //# sourceMappingURL=nuxt-v4.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nuxt-v4.d.ts","sourceRoot":"","sources":["../../../apps/accounts-ui/src/nuxt-v4.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAG1C,YAAY,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAGtE,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,8CAA8C,CAAA;AACxG,OAAO,EAAE,qBAAqB,EAAE,UAAU,EAAE,MAAM,qDAAqD,CAAA"}
package/dist/nuxt.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ export { default } from './nuxt/module';
2
+ export type { StrandsAuthConfig, StrandsAuthEndpoints } from './types';
3
+ export { useStrandsAuth, useAuthUser, useAuthState } from './nuxt/runtime/composables/useStrandsAuth';
4
+ export { useAuthenticatedFetch, $authFetch } from './nuxt/runtime/composables/useAuthenticatedFetch';
5
+ //# sourceMappingURL=nuxt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nuxt.d.ts","sourceRoot":"","sources":["../../../apps/accounts-ui/src/nuxt.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAGvC,YAAY,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAGtE,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAA;AACrG,OAAO,EAAE,qBAAqB,EAAE,UAAU,EAAE,MAAM,kDAAkD,CAAA"}
@@ -0,0 +1,3 @@
1
+ import { StrandsAuthConfig } from '../types';
2
+ export declare const STRANDS_AUTH_DEFAULTS: Required<Omit<StrandsAuthConfig, 'clientId' | 'supportEmail' | 'oauth2RedirectUrl'>>;
3
+ //# sourceMappingURL=defaults.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../../../apps/accounts-ui/src/shared/defaults.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAEjD,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,IAAI,CAAC,iBAAiB,EAAE,UAAU,GAAG,cAAc,GAAG,mBAAmB,CAAC,CAatH,CAAA"}