@strands.gg/accui 0.2.7 → 0.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/accui.css +1 -1
- package/dist/nuxt/module.cjs.js +1 -1
- package/dist/nuxt/module.cjs.js.map +1 -1
- package/dist/nuxt/module.d.ts +2 -67
- package/dist/nuxt/module.d.ts.map +1 -1
- package/dist/nuxt/module.es.js +26 -36
- package/dist/nuxt/module.es.js.map +1 -1
- package/dist/nuxt/runtime/composables/useStrandsAuth.cjs.js +1 -1
- package/dist/nuxt/runtime/composables/useStrandsAuth.cjs.js.map +1 -1
- package/dist/nuxt/runtime/composables/useStrandsAuth.d.ts +18 -3
- package/dist/nuxt/runtime/composables/useStrandsAuth.d.ts.map +1 -1
- package/dist/nuxt/runtime/composables/useStrandsAuth.es.js +1 -1
- package/dist/nuxt/runtime/composables/useStrandsAuth.es.js.map +1 -1
- package/dist/nuxt/runtime/middleware/auth.global.cjs.js.map +1 -1
- package/dist/nuxt/runtime/middleware/auth.global.es.js.map +1 -1
- package/dist/nuxt/runtime/plugin.client.cjs.js +1 -1
- package/dist/nuxt/runtime/plugin.client.cjs.js.map +1 -1
- package/dist/nuxt/runtime/plugin.client.d.ts.map +1 -1
- package/dist/nuxt/runtime/plugin.client.es.js +9 -22
- package/dist/nuxt/runtime/plugin.client.es.js.map +1 -1
- package/dist/nuxt/runtime/plugin.server.cjs.js +1 -1
- package/dist/nuxt/runtime/plugin.server.cjs.js.map +1 -1
- package/dist/nuxt/runtime/plugin.server.d.ts.map +1 -1
- package/dist/nuxt/runtime/plugin.server.es.js +9 -4
- package/dist/nuxt/runtime/plugin.server.es.js.map +1 -1
- package/dist/nuxt-v4/module.cjs.js +5 -5
- package/dist/nuxt-v4/module.cjs.js.map +1 -1
- package/dist/nuxt-v4/module.d.ts +2 -67
- package/dist/nuxt-v4/module.d.ts.map +1 -1
- package/dist/nuxt-v4/module.es.js +31 -41
- package/dist/nuxt-v4/module.es.js.map +1 -1
- package/dist/nuxt-v4/runtime/composables/useStrandsAuth.cjs.js +1 -1
- package/dist/nuxt-v4/runtime/composables/useStrandsAuth.cjs.js.map +1 -1
- package/dist/nuxt-v4/runtime/composables/useStrandsAuth.es.js +1 -1
- package/dist/nuxt-v4/runtime/composables/useStrandsAuth.es.js.map +1 -1
- package/dist/nuxt-v4/runtime/middleware/auth.global.cjs.js.map +1 -1
- package/dist/nuxt-v4/runtime/middleware/auth.global.es.js.map +1 -1
- package/dist/nuxt-v4/runtime/plugin.client.cjs.js +1 -1
- package/dist/nuxt-v4/runtime/plugin.client.cjs.js.map +1 -1
- package/dist/nuxt-v4/runtime/plugin.client.d.ts.map +1 -1
- package/dist/nuxt-v4/runtime/plugin.client.es.js +12 -32
- package/dist/nuxt-v4/runtime/plugin.client.es.js.map +1 -1
- package/dist/nuxt-v4/runtime/plugin.server.cjs.js +1 -1
- package/dist/nuxt-v4/runtime/plugin.server.cjs.js.map +1 -1
- package/dist/nuxt-v4/runtime/plugin.server.d.ts.map +1 -1
- package/dist/nuxt-v4/runtime/plugin.server.es.js +14 -10
- package/dist/nuxt-v4/runtime/plugin.server.es.js.map +1 -1
- package/dist/nuxt-v4/types.d.ts +4 -4
- package/dist/nuxt-v4.d.ts +1 -2
- package/dist/nuxt-v4.d.ts.map +1 -1
- package/dist/nuxt.d.ts +1 -2
- package/dist/nuxt.d.ts.map +1 -1
- package/dist/shared/defaults.d.ts +3 -0
- package/dist/shared/defaults.d.ts.map +1 -0
- package/dist/strands-auth-ui.cjs.js +11 -1
- package/dist/strands-auth-ui.cjs.js.map +1 -1
- package/dist/strands-auth-ui.es.js +1713 -1551
- package/dist/strands-auth-ui.es.js.map +1 -1
- package/dist/types/index.d.ts +66 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/useStrandsAuth-CPyy4tH6.js +213 -0
- package/dist/useStrandsAuth-CPyy4tH6.js.map +1 -0
- package/dist/useStrandsAuth-C_MiRZbU.cjs +2 -0
- package/dist/useStrandsAuth-C_MiRZbU.cjs.map +1 -0
- package/dist/useStrandsConfig-R8O__glt.cjs +2 -0
- package/dist/useStrandsConfig-R8O__glt.cjs.map +1 -0
- package/dist/useStrandsConfig-j-Bfv_s7.js +98 -0
- package/dist/useStrandsConfig-j-Bfv_s7.js.map +1 -0
- package/dist/vue/components/SignedIn.vue.d.ts +1 -0
- package/dist/vue/components/SignedIn.vue.d.ts.map +1 -1
- package/dist/vue/components/SignedOut.vue.d.ts.map +1 -1
- package/dist/vue/components/StrandsAuth.vue.d.ts.map +1 -1
- package/dist/vue/components/StrandsSignIn.vue.d.ts.map +1 -1
- package/dist/vue/components/StrandsSignUp.vue.d.ts.map +1 -1
- package/dist/vue/components/StrandsUserProfile.vue.d.ts +4 -1
- package/dist/vue/components/StrandsUserProfile.vue.d.ts.map +1 -1
- package/dist/vue/composables/useOAuthProviders.d.ts +18 -15
- package/dist/vue/composables/useOAuthProviders.d.ts.map +1 -1
- package/dist/vue/composables/useStrandsAuth.d.ts +18 -3
- package/dist/vue/composables/useStrandsAuth.d.ts.map +1 -1
- package/dist/vue/composables/useStrandsConfig.d.ts +4 -30
- package/dist/vue/composables/useStrandsConfig.d.ts.map +1 -1
- package/dist/vue/ui/UiLoader.vue.d.ts +15 -0
- package/dist/vue/ui/UiLoader.vue.d.ts.map +1 -0
- package/dist/vue/ui/index.d.ts +1 -0
- package/dist/vue/ui/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/useStrandsAuth-BGunGG2x.cjs +0 -2
- package/dist/useStrandsAuth-BGunGG2x.cjs.map +0 -1
- package/dist/useStrandsAuth-DiD32KI7.js +0 -91
- package/dist/useStrandsAuth-DiD32KI7.js.map +0 -1
- package/dist/useStrandsConfig-CPWn6FBj.cjs +0 -2
- package/dist/useStrandsConfig-CPWn6FBj.cjs.map +0 -1
- package/dist/useStrandsConfig-Ds4Yslxo.js +0 -105
- package/dist/useStrandsConfig-Ds4Yslxo.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.global.cjs.js","sources":["../../../../../../apps/accounts-ui/src/nuxt/runtime/middleware/auth.global.ts"],"sourcesContent":["import { defineNuxtRouteMiddleware, navigateTo, useRuntimeConfig } from 'nuxt/app'\nimport type { StrandsAuthConfig } from '
|
|
1
|
+
{"version":3,"file":"auth.global.cjs.js","sources":["../../../../../../apps/accounts-ui/src/nuxt/runtime/middleware/auth.global.ts"],"sourcesContent":["import { defineNuxtRouteMiddleware, navigateTo, useRuntimeConfig } from 'nuxt/app'\nimport type { StrandsAuthConfig } from '../../../types'\n\nexport default defineNuxtRouteMiddleware((to) => {\n const config = useRuntimeConfig().public['strandsAuth'] as StrandsAuthConfig\n\n // Skip middleware during SSR/build\n if (process.server) return\n\n // Import composable dynamically on client side\n return new Promise<void>((resolve) => {\n import('../composables/useStrandsAuth').then(({ useStrandsAuth }) => {\n const { isAuthenticated, isLoading } = useStrandsAuth()\n\n // Wait for auth initialization\n const checkAuth = () => {\n if (isLoading.value) {\n setTimeout(checkAuth, 50)\n return\n }\n\n const currentPath = to.path\n\n // Check if current route should be protected\n const isProtectedRoute = config.protectedRoutes?.some((route: string) => {\n if (route.endsWith('*')) {\n return currentPath.startsWith(route.slice(0, -1))\n }\n return currentPath === route || currentPath.startsWith(route + '/')\n })\n\n // Check if current route is guest-only\n const isGuestOnlyRoute = config.guestOnlyRoutes?.some((route: string) => {\n if (route.endsWith('*')) {\n return currentPath.startsWith(route.slice(0, -1))\n }\n return currentPath === route || currentPath.startsWith(route + '/')\n })\n\n // Redirect unauthenticated users from protected routes\n if (isProtectedRoute && !isAuthenticated.value) {\n console.log('[Strands Auth] Protected route accessed without authentication, redirecting to auth')\n return navigateTo('/auth?redirect=' + encodeURIComponent(currentPath))\n }\n\n // Redirect authenticated users from guest-only routes\n if (isGuestOnlyRoute && isAuthenticated.value) {\n console.log('[Strands Auth] Guest-only route accessed while authenticated, redirecting')\n return navigateTo(config.onSignInUrl || '/dashboard')\n }\n\n resolve()\n }\n\n checkAuth()\n })\n })\n})"],"names":["auth_global","defineNuxtRouteMiddleware","to","config","useRuntimeConfig","resolve","useStrandsAuth","isAuthenticated","isLoading","checkAuth","currentPath","isProtectedRoute","route","isGuestOnlyRoute","navigateTo"],"mappings":"yCAGAA,EAAeC,EAAAA,0BAA2BC,GAAO,CAC/C,MAAMC,EAASC,EAAAA,mBAAmB,OAAO,YAGzC,GAAI,SAAQ,OAGZ,OAAO,IAAI,QAAeC,GAAY,CACpC,QAAA,QAAA,EAAA,KAAA,IAAA,QAAO,sCAA+B,CAAA,EAAE,KAAK,CAAC,CAAE,eAAAC,KAAqB,CACnE,KAAM,CAAE,gBAAAC,EAAiB,UAAAC,CAAA,EAAcF,EAAA,EAGjCG,EAAY,IAAM,CACtB,GAAID,EAAU,MAAO,CACnB,WAAWC,EAAW,EAAE,EACxB,MACF,CAEA,MAAMC,EAAcR,EAAG,KAGjBS,EAAmBR,EAAO,iBAAiB,KAAMS,GACjDA,EAAM,SAAS,GAAG,EACbF,EAAY,WAAWE,EAAM,MAAM,EAAG,EAAE,CAAC,EAE3CF,IAAgBE,GAASF,EAAY,WAAWE,EAAQ,GAAG,CACnE,EAGKC,EAAmBV,EAAO,iBAAiB,KAAMS,GACjDA,EAAM,SAAS,GAAG,EACbF,EAAY,WAAWE,EAAM,MAAM,EAAG,EAAE,CAAC,EAE3CF,IAAgBE,GAASF,EAAY,WAAWE,EAAQ,GAAG,CACnE,EAGD,GAAID,GAAoB,CAACJ,EAAgB,MACvC,eAAQ,IAAI,qFAAqF,EAC1FO,aAAW,kBAAoB,mBAAmBJ,CAAW,CAAC,EAIvE,GAAIG,GAAoBN,EAAgB,MACtC,eAAQ,IAAI,2EAA2E,EAChFO,aAAWX,EAAO,aAAe,YAAY,EAGtDE,EAAA,CACF,EAEAI,EAAA,CACF,CAAC,CACH,CAAC,CACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.global.es.js","sources":["../../../../../../apps/accounts-ui/src/nuxt/runtime/middleware/auth.global.ts"],"sourcesContent":["import { defineNuxtRouteMiddleware, navigateTo, useRuntimeConfig } from 'nuxt/app'\nimport type { StrandsAuthConfig } from '
|
|
1
|
+
{"version":3,"file":"auth.global.es.js","sources":["../../../../../../apps/accounts-ui/src/nuxt/runtime/middleware/auth.global.ts"],"sourcesContent":["import { defineNuxtRouteMiddleware, navigateTo, useRuntimeConfig } from 'nuxt/app'\nimport type { StrandsAuthConfig } from '../../../types'\n\nexport default defineNuxtRouteMiddleware((to) => {\n const config = useRuntimeConfig().public['strandsAuth'] as StrandsAuthConfig\n\n // Skip middleware during SSR/build\n if (process.server) return\n\n // Import composable dynamically on client side\n return new Promise<void>((resolve) => {\n import('../composables/useStrandsAuth').then(({ useStrandsAuth }) => {\n const { isAuthenticated, isLoading } = useStrandsAuth()\n\n // Wait for auth initialization\n const checkAuth = () => {\n if (isLoading.value) {\n setTimeout(checkAuth, 50)\n return\n }\n\n const currentPath = to.path\n\n // Check if current route should be protected\n const isProtectedRoute = config.protectedRoutes?.some((route: string) => {\n if (route.endsWith('*')) {\n return currentPath.startsWith(route.slice(0, -1))\n }\n return currentPath === route || currentPath.startsWith(route + '/')\n })\n\n // Check if current route is guest-only\n const isGuestOnlyRoute = config.guestOnlyRoutes?.some((route: string) => {\n if (route.endsWith('*')) {\n return currentPath.startsWith(route.slice(0, -1))\n }\n return currentPath === route || currentPath.startsWith(route + '/')\n })\n\n // Redirect unauthenticated users from protected routes\n if (isProtectedRoute && !isAuthenticated.value) {\n console.log('[Strands Auth] Protected route accessed without authentication, redirecting to auth')\n return navigateTo('/auth?redirect=' + encodeURIComponent(currentPath))\n }\n\n // Redirect authenticated users from guest-only routes\n if (isGuestOnlyRoute && isAuthenticated.value) {\n console.log('[Strands Auth] Guest-only route accessed while authenticated, redirecting')\n return navigateTo(config.onSignInUrl || '/dashboard')\n }\n\n resolve()\n }\n\n checkAuth()\n })\n })\n})"],"names":["auth_global","defineNuxtRouteMiddleware","to","config","useRuntimeConfig","resolve","useStrandsAuth","isAuthenticated","isLoading","checkAuth","currentPath","isProtectedRoute","route","isGuestOnlyRoute","navigateTo"],"mappings":";AAGA,MAAAA,IAAeC,EAA0B,CAACC,MAAO;AAC/C,QAAMC,IAASC,IAAmB,OAAO;AAGzC,MAAI,SAAQ;AAGZ,WAAO,IAAI,QAAc,CAACC,MAAY;AACpC,aAAO,qCAA+B,EAAE,KAAK,CAAC,EAAE,gBAAAC,QAAqB;AACnE,cAAM,EAAE,iBAAAC,GAAiB,WAAAC,EAAA,IAAcF,EAAA,GAGjCG,IAAY,MAAM;AACtB,cAAID,EAAU,OAAO;AACnB,uBAAWC,GAAW,EAAE;AACxB;AAAA,UACF;AAEA,gBAAMC,IAAcR,EAAG,MAGjBS,IAAmBR,EAAO,iBAAiB,KAAK,CAACS,MACjDA,EAAM,SAAS,GAAG,IACbF,EAAY,WAAWE,EAAM,MAAM,GAAG,EAAE,CAAC,IAE3CF,MAAgBE,KAASF,EAAY,WAAWE,IAAQ,GAAG,CACnE,GAGKC,IAAmBV,EAAO,iBAAiB,KAAK,CAACS,MACjDA,EAAM,SAAS,GAAG,IACbF,EAAY,WAAWE,EAAM,MAAM,GAAG,EAAE,CAAC,IAE3CF,MAAgBE,KAASF,EAAY,WAAWE,IAAQ,GAAG,CACnE;AAGD,cAAID,KAAoB,CAACJ,EAAgB;AACvC,2BAAQ,IAAI,qFAAqF,GAC1FO,EAAW,oBAAoB,mBAAmBJ,CAAW,CAAC;AAIvE,cAAIG,KAAoBN,EAAgB;AACtC,2BAAQ,IAAI,2EAA2E,GAChFO,EAAWX,EAAO,eAAe,YAAY;AAGtD,UAAAE,EAAA;AAAA,QACF;AAEA,QAAAI,EAAA;AAAA,MACF,CAAC;AAAA,IACH,CAAC;AACH,CAAC;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const e=require("nuxt/app"),t=require("../../useStrandsConfig-
|
|
1
|
+
"use strict";const e=require("nuxt/app"),t=require("../../useStrandsConfig-R8O__glt.cjs"),c=e.defineNuxtPlugin({name:"strands-auth-client",async setup(){const i=e.useRuntimeConfig().public.strandsAuth,n={...t.STRANDS_AUTH_DEFAULTS,...i};t.provideStrandsConfig(n),typeof window<"u"&&(window.__STRANDS_CONFIG__=n),n?.accentColor&&typeof window<"u"&&document.documentElement.style.setProperty("--strands-accent",n.accentColor);const{useStrandsAuth:o}=await Promise.resolve().then(()=>require("./composables/useStrandsAuth.cjs.js")),{initialize:s}=o();await s()}});module.exports=c;
|
|
2
2
|
//# sourceMappingURL=plugin.client.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.client.cjs.js","sources":["../../../../../apps/accounts-ui/src/nuxt/runtime/plugin.client.ts"],"sourcesContent":["import { defineNuxtPlugin, useRuntimeConfig } from 'nuxt/app'\nimport { provideStrandsConfig } from '../../vue/composables/useStrandsConfig'\n\nexport default defineNuxtPlugin({\n name: 'strands-auth-client',\n async setup() {\n // Get runtime config\n const config = useRuntimeConfig()\n const strandsConfig = config.public.strandsAuth as any\n \n //
|
|
1
|
+
{"version":3,"file":"plugin.client.cjs.js","sources":["../../../../../apps/accounts-ui/src/nuxt/runtime/plugin.client.ts"],"sourcesContent":["import { defineNuxtPlugin, useRuntimeConfig } from 'nuxt/app'\nimport { provideStrandsConfig } from '../../vue/composables/useStrandsConfig'\nimport { STRANDS_AUTH_DEFAULTS } from '../../shared/defaults'\n\nexport default defineNuxtPlugin({\n name: 'strands-auth-client',\n async setup() {\n // Get runtime config\n const config = useRuntimeConfig()\n const strandsConfig = config.public.strandsAuth as any\n \n // Merge defaults with runtime config\n const mergedConfig = {\n ...STRANDS_AUTH_DEFAULTS,\n ...strandsConfig\n }\n \n // Provide configuration to Vue components\n provideStrandsConfig(mergedConfig)\n \n // Set window global as backup\n if (typeof window !== 'undefined') {\n ;(window as any).__STRANDS_CONFIG__ = mergedConfig\n }\n \n // Set CSS custom properties for accent color\n if (mergedConfig?.accentColor && typeof window !== 'undefined') {\n document.documentElement.style.setProperty('--strands-accent', mergedConfig.accentColor)\n }\n \n // Initialize auth state\n const { useStrandsAuth } = await import('./composables/useStrandsAuth')\n const { initialize } = useStrandsAuth()\n await initialize()\n }\n})"],"names":["plugin_client","defineNuxtPlugin","strandsConfig","useRuntimeConfig","mergedConfig","STRANDS_AUTH_DEFAULTS","provideStrandsConfig","useStrandsAuth","initialize"],"mappings":"0FAIAA,EAAeC,mBAAiB,CAC9B,KAAM,sBACN,MAAM,OAAQ,CAGZ,MAAMC,EADSC,EAAAA,iBAAA,EACc,OAAO,YAG9BC,EAAe,CACnB,GAAGC,EAAAA,sBACH,GAAGH,CAAA,EAILI,EAAAA,qBAAqBF,CAAY,EAG7B,OAAO,OAAW,MAClB,OAAe,mBAAqBA,GAIpCA,GAAc,aAAe,OAAO,OAAW,KACjD,SAAS,gBAAgB,MAAM,YAAY,mBAAoBA,EAAa,WAAW,EAIzF,KAAM,CAAE,eAAAG,CAAA,EAAmB,MAAM,QAAA,QAAA,EAAA,KAAA,IAAA,QAAO,qCAA8B,CAAA,EAChE,CAAE,WAAAC,CAAA,EAAeD,EAAA,EACvB,MAAMC,EAAA,CACR,CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.client.d.ts","sourceRoot":"","sources":["../../../../../apps/accounts-ui/src/nuxt/runtime/plugin.client.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"plugin.client.d.ts","sourceRoot":"","sources":["../../../../../apps/accounts-ui/src/nuxt/runtime/plugin.client.ts"],"names":[],"mappings":";AAIA,wBA+BE"}
|
|
@@ -1,28 +1,15 @@
|
|
|
1
|
-
import { defineNuxtPlugin as i, useRuntimeConfig as
|
|
2
|
-
import { p as
|
|
1
|
+
import { defineNuxtPlugin as i, useRuntimeConfig as s } from "nuxt/app";
|
|
2
|
+
import { p as a, S as c } from "../../useStrandsConfig-j-Bfv_s7.js";
|
|
3
3
|
const u = i({
|
|
4
4
|
name: "strands-auth-client",
|
|
5
5
|
async setup() {
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
supportEmail: n.supportEmail
|
|
14
|
-
})) : (console.warn("[Strands Auth] No baseUrl found in config. Using emergency fallback.", n), t({
|
|
15
|
-
baseUrl: "",
|
|
16
|
-
// Empty string to trigger fallback logic in composable
|
|
17
|
-
endpoints: n.endpoints || {},
|
|
18
|
-
supportEmail: n.supportEmail
|
|
19
|
-
})) : (console.warn("[Strands Auth] No strandsAuth config found in Nuxt configuration."), t({
|
|
20
|
-
baseUrl: "",
|
|
21
|
-
// Empty string to trigger fallback logic in composable
|
|
22
|
-
endpoints: {}
|
|
23
|
-
})), n?.accentColor && typeof window < "u" && document.documentElement.style.setProperty("--strands-accent", n.accentColor);
|
|
24
|
-
const { useStrandsAuth: o } = await import("./composables/useStrandsAuth.es.js"), { initialize: s } = o();
|
|
25
|
-
await s(), console.log("[Strands Auth] Client plugin initialized");
|
|
6
|
+
const t = s().public.strandsAuth, n = {
|
|
7
|
+
...c,
|
|
8
|
+
...t
|
|
9
|
+
};
|
|
10
|
+
a(n), typeof window < "u" && (window.__STRANDS_CONFIG__ = n), n?.accentColor && typeof window < "u" && document.documentElement.style.setProperty("--strands-accent", n.accentColor);
|
|
11
|
+
const { useStrandsAuth: e } = await import("./composables/useStrandsAuth.es.js"), { initialize: o } = e();
|
|
12
|
+
await o();
|
|
26
13
|
}
|
|
27
14
|
});
|
|
28
15
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.client.es.js","sources":["../../../../../apps/accounts-ui/src/nuxt/runtime/plugin.client.ts"],"sourcesContent":["import { defineNuxtPlugin, useRuntimeConfig } from 'nuxt/app'\nimport { provideStrandsConfig } from '../../vue/composables/useStrandsConfig'\n\nexport default defineNuxtPlugin({\n name: 'strands-auth-client',\n async setup() {\n // Get runtime config\n const config = useRuntimeConfig()\n const strandsConfig = config.public.strandsAuth as any\n \n //
|
|
1
|
+
{"version":3,"file":"plugin.client.es.js","sources":["../../../../../apps/accounts-ui/src/nuxt/runtime/plugin.client.ts"],"sourcesContent":["import { defineNuxtPlugin, useRuntimeConfig } from 'nuxt/app'\nimport { provideStrandsConfig } from '../../vue/composables/useStrandsConfig'\nimport { STRANDS_AUTH_DEFAULTS } from '../../shared/defaults'\n\nexport default defineNuxtPlugin({\n name: 'strands-auth-client',\n async setup() {\n // Get runtime config\n const config = useRuntimeConfig()\n const strandsConfig = config.public.strandsAuth as any\n \n // Merge defaults with runtime config\n const mergedConfig = {\n ...STRANDS_AUTH_DEFAULTS,\n ...strandsConfig\n }\n \n // Provide configuration to Vue components\n provideStrandsConfig(mergedConfig)\n \n // Set window global as backup\n if (typeof window !== 'undefined') {\n ;(window as any).__STRANDS_CONFIG__ = mergedConfig\n }\n \n // Set CSS custom properties for accent color\n if (mergedConfig?.accentColor && typeof window !== 'undefined') {\n document.documentElement.style.setProperty('--strands-accent', mergedConfig.accentColor)\n }\n \n // Initialize auth state\n const { useStrandsAuth } = await import('./composables/useStrandsAuth')\n const { initialize } = useStrandsAuth()\n await initialize()\n }\n})"],"names":["plugin_client","defineNuxtPlugin","strandsConfig","useRuntimeConfig","mergedConfig","STRANDS_AUTH_DEFAULTS","provideStrandsConfig","useStrandsAuth","initialize"],"mappings":";;AAIA,MAAAA,IAAeC,EAAiB;AAAA,EAC9B,MAAM;AAAA,EACN,MAAM,QAAQ;AAGZ,UAAMC,IADSC,EAAA,EACc,OAAO,aAG9BC,IAAe;AAAA,MACnB,GAAGC;AAAA,MACH,GAAGH;AAAA,IAAA;AAIL,IAAAI,EAAqBF,CAAY,GAG7B,OAAO,SAAW,QAClB,OAAe,qBAAqBA,IAIpCA,GAAc,eAAe,OAAO,SAAW,OACjD,SAAS,gBAAgB,MAAM,YAAY,oBAAoBA,EAAa,WAAW;AAIzF,UAAM,EAAE,gBAAAG,EAAA,IAAmB,MAAM,OAAO,oCAA8B,GAChE,EAAE,YAAAC,EAAA,IAAeD,EAAA;AACvB,UAAMC,EAAA;AAAA,EACR;AACF,CAAC;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const n=require("nuxt/app"),s=require("../../useStrandsConfig-R8O__glt.cjs"),r=n.defineNuxtPlugin({name:"strands-auth-server",setup(){const e=n.useRuntimeConfig().public.strandsAuth,t={...s.STRANDS_AUTH_DEFAULTS,...e};s.provideStrandsConfig(t)}});module.exports=r;
|
|
2
2
|
//# sourceMappingURL=plugin.server.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.server.cjs.js","sources":["../../../../../apps/accounts-ui/src/nuxt/runtime/plugin.server.ts"],"sourcesContent":["import { defineNuxtPlugin } from 'nuxt/app'\n\nexport default defineNuxtPlugin({\n name: 'strands-auth-server',\n setup() {\n //
|
|
1
|
+
{"version":3,"file":"plugin.server.cjs.js","sources":["../../../../../apps/accounts-ui/src/nuxt/runtime/plugin.server.ts"],"sourcesContent":["import { defineNuxtPlugin, useRuntimeConfig } from 'nuxt/app'\nimport { provideStrandsConfig } from '../../vue/composables/useStrandsConfig'\nimport { STRANDS_AUTH_DEFAULTS } from '../../shared/defaults'\n\nexport default defineNuxtPlugin({\n name: 'strands-auth-server',\n setup() {\n // Get runtime config\n const config = useRuntimeConfig()\n const strandsConfig = config.public.strandsAuth as any\n \n // Merge defaults with runtime config\n const mergedConfig = {\n ...STRANDS_AUTH_DEFAULTS,\n ...strandsConfig\n }\n \n // Provide configuration for SSR\n provideStrandsConfig(mergedConfig)\n }\n})"],"names":["plugin_server","defineNuxtPlugin","strandsConfig","useRuntimeConfig","mergedConfig","STRANDS_AUTH_DEFAULTS","provideStrandsConfig"],"mappings":"0FAIAA,EAAeC,mBAAiB,CAC9B,KAAM,sBACN,OAAQ,CAGN,MAAMC,EADSC,EAAAA,iBAAA,EACc,OAAO,YAG9BC,EAAe,CACnB,GAAGC,EAAAA,sBACH,GAAGH,CAAA,EAILI,EAAAA,qBAAqBF,CAAY,CACnC,CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.server.d.ts","sourceRoot":"","sources":["../../../../../apps/accounts-ui/src/nuxt/runtime/plugin.server.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"plugin.server.d.ts","sourceRoot":"","sources":["../../../../../apps/accounts-ui/src/nuxt/runtime/plugin.server.ts"],"names":[],"mappings":";AAIA,wBAgBE"}
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
import { defineNuxtPlugin as
|
|
2
|
-
|
|
1
|
+
import { defineNuxtPlugin as t, useRuntimeConfig as o } from "nuxt/app";
|
|
2
|
+
import { p as e, S as r } from "../../useStrandsConfig-j-Bfv_s7.js";
|
|
3
|
+
const u = t({
|
|
3
4
|
name: "strands-auth-server",
|
|
4
5
|
setup() {
|
|
5
|
-
|
|
6
|
+
const n = o().public.strandsAuth, s = {
|
|
7
|
+
...r,
|
|
8
|
+
...n
|
|
9
|
+
};
|
|
10
|
+
e(s);
|
|
6
11
|
}
|
|
7
12
|
});
|
|
8
13
|
export {
|
|
9
|
-
|
|
14
|
+
u as default
|
|
10
15
|
};
|
|
11
16
|
//# sourceMappingURL=plugin.server.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.server.es.js","sources":["../../../../../apps/accounts-ui/src/nuxt/runtime/plugin.server.ts"],"sourcesContent":["import { defineNuxtPlugin } from 'nuxt/app'\n\nexport default defineNuxtPlugin({\n name: 'strands-auth-server',\n setup() {\n //
|
|
1
|
+
{"version":3,"file":"plugin.server.es.js","sources":["../../../../../apps/accounts-ui/src/nuxt/runtime/plugin.server.ts"],"sourcesContent":["import { defineNuxtPlugin, useRuntimeConfig } from 'nuxt/app'\nimport { provideStrandsConfig } from '../../vue/composables/useStrandsConfig'\nimport { STRANDS_AUTH_DEFAULTS } from '../../shared/defaults'\n\nexport default defineNuxtPlugin({\n name: 'strands-auth-server',\n setup() {\n // Get runtime config\n const config = useRuntimeConfig()\n const strandsConfig = config.public.strandsAuth as any\n \n // Merge defaults with runtime config\n const mergedConfig = {\n ...STRANDS_AUTH_DEFAULTS,\n ...strandsConfig\n }\n \n // Provide configuration for SSR\n provideStrandsConfig(mergedConfig)\n }\n})"],"names":["plugin_server","defineNuxtPlugin","strandsConfig","useRuntimeConfig","mergedConfig","STRANDS_AUTH_DEFAULTS","provideStrandsConfig"],"mappings":";;AAIA,MAAAA,IAAeC,EAAiB;AAAA,EAC9B,MAAM;AAAA,EACN,QAAQ;AAGN,UAAMC,IADSC,EAAA,EACc,OAAO,aAG9BC,IAAe;AAAA,MACnB,GAAGC;AAAA,MACH,GAAGH;AAAA,IAAA;AAIL,IAAAI,EAAqBF,CAAY;AAAA,EACnC;AACF,CAAC;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const t=require("@nuxt/kit");var a=typeof document<"u"?document.currentScript:null;const h=t.defineNuxtModule({meta:{name:"@strands.gg/accui/nuxt-v4",configKey:"strandsAuth",compatibility:{nuxt:"^4.0.0"}},defaults:{baseUrl:"https://your-api.example.com",accentColor:"#EA00A8",redirectUrl:"/",onSignInUrl:"/dashboard",onSignOutUrl:"/",autoRefresh:!0,refreshInterval:4,protectedRoutes:[],guestOnlyRoutes:["/auth","/login","/register"],devMode:!1,styles:!0},async setup(o,s){const e=t.createResolver(typeof document>"u"?require("url").pathToFileURL(__filename).href:a&&a.tagName.toUpperCase()==="SCRIPT"&&a.src||new URL("nuxt-v4/module.cjs.js",document.baseURI).href);s.options.runtimeConfig.public=s.options.runtimeConfig.public||{};const i={...o,styles:o.styles!==!1};s.options.runtimeConfig.public.strandsAuth=i,s.options.appConfig.strandsAuth=i,o.styles!==!1&&s.options.css.push("@strands.gg/accui/style.css");const d=process.env.NODE_ENV==="development",r=d?"ts":"es.js",l=e.resolve(`./runtime/plugin.client.${r}`),c=e.resolve(`./runtime/plugin.server.${r}`),p=e.resolve(`./runtime/middleware/auth.global.${r}`);t.addPlugin({src:l,mode:"client"}),t.addPlugin({src:c,mode:"server"}),t.addRouteMiddleware({name:"auth",path:p,global:!0}),t.addImports([{name:"useStrandsAuth",as:"useStrandsAuth",from:e.resolve(`./runtime/composables/useStrandsAuth.${r}`)},{name:"useAuthUser",as:"useAuthUser",from:e.resolve(`./runtime/composables/useStrandsAuth.${r}`)},{name:"useAuthState",as:"useAuthState",from:e.resolve(`./runtime/composables/useStrandsAuth.${r}`)}]);const m=["StrandsAuth","StrandsSignIn","StrandsSignUp","StrandsCompleteSignUp","StrandsUserProfile","StrandsPasswordReset","StrandsMFASetup","StrandsConfigProvider","SignedIn","SignedOut","StrandsLogo","StrandsSecuredFooter"];for(const n of m)t.addComponent({name:n,export:n,filePath:"@strands.gg/accui"});s.hook("prepare:types",n=>{n.references.push({types:"@strands.gg/auth-nuxt-v4"});const u=d?"ts":"d.ts";n.declarations.push(`
|
|
2
2
|
declare global {
|
|
3
|
-
const useStrandsAuth: typeof import('${
|
|
4
|
-
const useAuthUser: typeof import('${
|
|
5
|
-
const useAuthState: typeof import('${
|
|
3
|
+
const useStrandsAuth: typeof import('${e.resolve(`./runtime/composables/useStrandsAuth.${u}`)}')['useStrandsAuth']
|
|
4
|
+
const useAuthUser: typeof import('${e.resolve(`./runtime/composables/useStrandsAuth.${u}`)}')['useAuthUser']
|
|
5
|
+
const useAuthState: typeof import('${e.resolve(`./runtime/composables/useStrandsAuth.${u}`)}')['useAuthState']
|
|
6
6
|
}
|
|
7
|
-
`)})}});module.exports=
|
|
7
|
+
`)})}});module.exports=h;
|
|
8
8
|
//# sourceMappingURL=module.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.cjs.js","sources":["../../../../apps/accounts-ui/src/nuxt-v4/module.ts"],"sourcesContent":["import { defineNuxtModule, addPlugin, createResolver, addImports, addComponent, addRouteMiddleware } from '@nuxt/kit'\n\
|
|
1
|
+
{"version":3,"file":"module.cjs.js","sources":["../../../../apps/accounts-ui/src/nuxt-v4/module.ts"],"sourcesContent":["import { defineNuxtModule, addPlugin, createResolver, addImports, addComponent, addRouteMiddleware } from '@nuxt/kit'\n\n// Re-export types for users\nexport type { StrandsAuthConfig, StrandsAuthEndpoints } from '../types'\nimport type { StrandsAuthConfig } from '../types'\n\nexport default defineNuxtModule<StrandsAuthConfig>({\n meta: {\n name: '@strands.gg/accui/nuxt-v4',\n configKey: 'strandsAuth',\n compatibility: {\n nuxt: '^4.0.0'\n }\n },\n defaults: {\n baseUrl: 'https://your-api.example.com',\n accentColor: '#EA00A8',\n redirectUrl: '/',\n onSignInUrl: '/dashboard',\n onSignOutUrl: '/',\n autoRefresh: true,\n refreshInterval: 4,\n protectedRoutes: [],\n guestOnlyRoutes: ['/auth', '/login', '/register'],\n devMode: false,\n styles: true\n },\n async setup(options, nuxt) {\n const resolver = createResolver(import.meta.url)\n\n // Add runtime config\n nuxt.options.runtimeConfig.public = nuxt.options.runtimeConfig.public || {}\n const runtimeConfig = {\n ...options,\n styles: options.styles !== false\n }\n \n ;(nuxt.options.runtimeConfig.public as any).strandsAuth = runtimeConfig\n \n // Also add it to app config for immediate access\n ;(nuxt.options.appConfig as any).strandsAuth = runtimeConfig\n\n // Conditionally add CSS for styling based on autoImportStyles setting\n if (options.styles !== false) {\n nuxt.options.css.push('@strands.gg/accui/style.css')\n }\n\n // Plugin and middleware paths - use TypeScript in development, JavaScript in production\n // Detect if we're in development (source files exist) or production (built files)\n const isDev = process.env['NODE_ENV'] === 'development'\n const ext = isDev ? 'ts' : 'es.js'\n \n const clientPluginPath = resolver.resolve(`./runtime/plugin.client.${ext}`)\n const serverPluginPath = resolver.resolve(`./runtime/plugin.server.${ext}`) \n const middlewarePath = resolver.resolve(`./runtime/middleware/auth.global.${ext}`)\n\n // Add the main plugin with highest priority to ensure config is set early\n addPlugin({\n src: clientPluginPath,\n mode: 'client'\n })\n\n // Add server plugin for SSR support \n addPlugin({\n src: serverPluginPath,\n mode: 'server'\n })\n\n // Add middleware for route protection (updated for Nuxt v4)\n addRouteMiddleware({\n name: 'auth',\n path: middlewarePath,\n global: true\n })\n\n // Auto-import composables - use TypeScript in development, JavaScript in production\n addImports([\n {\n name: 'useStrandsAuth',\n as: 'useStrandsAuth',\n from: resolver.resolve(`./runtime/composables/useStrandsAuth.${ext}`)\n },\n {\n name: 'useAuthUser',\n as: 'useAuthUser', \n from: resolver.resolve(`./runtime/composables/useStrandsAuth.${ext}`)\n },\n {\n name: 'useAuthState',\n as: 'useAuthState',\n from: resolver.resolve(`./runtime/composables/useStrandsAuth.${ext}`)\n }\n ])\n\n // Auto-register components from the main bundle export\n const components = [\n 'StrandsAuth',\n 'StrandsSignIn', \n 'StrandsSignUp',\n 'StrandsCompleteSignUp',\n 'StrandsUserProfile',\n 'StrandsPasswordReset',\n 'StrandsMFASetup',\n 'StrandsConfigProvider',\n 'SignedIn',\n 'SignedOut',\n 'StrandsLogo',\n 'StrandsSecuredFooter'\n ]\n\n for (const component of components) {\n addComponent({\n name: component,\n export: component,\n filePath: '@strands.gg/accui'\n })\n }\n\n // Add type declarations (updated for Nuxt v4)\n nuxt.hook('prepare:types', (opts) => {\n opts.references.push({\n types: '@strands.gg/auth-nuxt-v4'\n })\n \n // Add the composables to the auto-imports types\n const typeExt = isDev ? 'ts' : 'd.ts'\n opts.declarations.push(`\n declare global {\n const useStrandsAuth: typeof import('${resolver.resolve(`./runtime/composables/useStrandsAuth.${typeExt}`)}')['useStrandsAuth']\n const useAuthUser: typeof import('${resolver.resolve(`./runtime/composables/useStrandsAuth.${typeExt}`)}')['useAuthUser']\n const useAuthState: typeof import('${resolver.resolve(`./runtime/composables/useStrandsAuth.${typeExt}`)}')['useAuthState']\n }\n `)\n })\n }\n})\n"],"names":["module$1","defineNuxtModule","options","nuxt","resolver","createResolver","runtimeConfig","isDev","ext","clientPluginPath","serverPluginPath","middlewarePath","addPlugin","addRouteMiddleware","addImports","components","component","addComponent","opts","typeExt"],"mappings":"gGAMA,MAAAA,EAAeC,mBAAoC,CACjD,KAAM,CACJ,KAAM,4BACN,UAAW,cACX,cAAe,CACb,KAAM,QAAA,CACR,EAEF,SAAU,CACR,QAAS,+BACT,YAAa,UACb,YAAa,IACb,YAAa,aACb,aAAc,IACd,YAAa,GACb,gBAAiB,EACjB,gBAAiB,CAAA,EACjB,gBAAiB,CAAC,QAAS,SAAU,WAAW,EAChD,QAAS,GACT,OAAQ,EAAA,EAEV,MAAM,MAAMC,EAASC,EAAM,CACzB,MAAMC,EAAWC,EAAAA,qLAA8B,EAG/CF,EAAK,QAAQ,cAAc,OAASA,EAAK,QAAQ,cAAc,QAAU,CAAA,EACzE,MAAMG,EAAgB,CACpB,GAAGJ,EACH,OAAQA,EAAQ,SAAW,EAAA,EAG3BC,EAAK,QAAQ,cAAc,OAAe,YAAcG,EAGxDH,EAAK,QAAQ,UAAkB,YAAcG,EAG3CJ,EAAQ,SAAW,IACrBC,EAAK,QAAQ,IAAI,KAAK,6BAA6B,EAKrD,MAAMI,EAAQ,QAAQ,IAAI,WAAgB,cACpCC,EAAMD,EAAQ,KAAO,QAErBE,EAAmBL,EAAS,QAAQ,2BAA2BI,CAAG,EAAE,EACpEE,EAAmBN,EAAS,QAAQ,2BAA2BI,CAAG,EAAE,EACpEG,EAAiBP,EAAS,QAAQ,oCAAoCI,CAAG,EAAE,EAGjFI,YAAU,CACR,IAAKH,EACL,KAAM,QAAA,CACP,EAGDG,YAAU,CACR,IAAKF,EACL,KAAM,QAAA,CACP,EAGDG,qBAAmB,CACjB,KAAM,OACN,KAAMF,EACN,OAAQ,EAAA,CACT,EAGDG,aAAW,CACT,CACE,KAAM,iBACN,GAAI,iBACJ,KAAMV,EAAS,QAAQ,wCAAwCI,CAAG,EAAE,CAAA,EAEtE,CACE,KAAM,cACN,GAAI,cACJ,KAAMJ,EAAS,QAAQ,wCAAwCI,CAAG,EAAE,CAAA,EAEtE,CACE,KAAM,eACN,GAAI,eACJ,KAAMJ,EAAS,QAAQ,wCAAwCI,CAAG,EAAE,CAAA,CACtE,CACD,EAGD,MAAMO,EAAa,CACjB,cACA,gBACA,gBACA,wBACA,qBACA,uBACA,kBACA,wBACA,WACA,YACA,cACA,sBAAA,EAGF,UAAWC,KAAaD,EACtBE,eAAa,CACX,KAAMD,EACN,OAAQA,EACR,SAAU,mBAAA,CACX,EAIHb,EAAK,KAAK,gBAAkBe,GAAS,CACnCA,EAAK,WAAW,KAAK,CACnB,MAAO,0BAAA,CACR,EAGD,MAAMC,EAAUZ,EAAQ,KAAO,OAC/BW,EAAK,aAAa,KAAK;AAAA;AAAA,iDAEoBd,EAAS,QAAQ,wCAAwCe,CAAO,EAAE,CAAC;AAAA,8CACtEf,EAAS,QAAQ,wCAAwCe,CAAO,EAAE,CAAC;AAAA,+CAClEf,EAAS,QAAQ,wCAAwCe,CAAO,EAAE,CAAC;AAAA;AAAA,OAE3G,CACH,CAAC,CACH,CACF,CAAC"}
|
package/dist/nuxt-v4/module.d.ts
CHANGED
|
@@ -1,70 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* Base URL for the Strands Auth API
|
|
4
|
-
* @default 'https://your-api.example.com'
|
|
5
|
-
*/
|
|
6
|
-
baseUrl?: string;
|
|
7
|
-
/**
|
|
8
|
-
* Client ID for authentication (optional - authentication is now based on domain)
|
|
9
|
-
*/
|
|
10
|
-
clientId?: string;
|
|
11
|
-
/**
|
|
12
|
-
* Primary accent color for the auth components
|
|
13
|
-
* @default '#EA00A8'
|
|
14
|
-
*/
|
|
15
|
-
accentColor?: string;
|
|
16
|
-
/**
|
|
17
|
-
* Default redirect URL after successful authentication
|
|
18
|
-
* @default '/'
|
|
19
|
-
*/
|
|
20
|
-
redirectUrl?: string;
|
|
21
|
-
/**
|
|
22
|
-
* URL to redirect to after successful sign in
|
|
23
|
-
* @default '/dashboard'
|
|
24
|
-
*/
|
|
25
|
-
onSignInUrl?: string;
|
|
26
|
-
/**
|
|
27
|
-
* URL to redirect to after successful sign out
|
|
28
|
-
* @default '/'
|
|
29
|
-
*/
|
|
30
|
-
onSignOutUrl?: string;
|
|
31
|
-
/**
|
|
32
|
-
* Enable automatic token refresh
|
|
33
|
-
* @default true
|
|
34
|
-
*/
|
|
35
|
-
autoRefresh?: boolean;
|
|
36
|
-
/**
|
|
37
|
-
* Token refresh interval in minutes
|
|
38
|
-
* @default 4
|
|
39
|
-
*/
|
|
40
|
-
refreshInterval?: number;
|
|
41
|
-
/**
|
|
42
|
-
* Pages that should redirect to sign in if user is not authenticated
|
|
43
|
-
* @default []
|
|
44
|
-
*/
|
|
45
|
-
protectedRoutes?: string[];
|
|
46
|
-
/**
|
|
47
|
-
* Pages that should redirect away if user IS authenticated
|
|
48
|
-
* @default ['/auth', '/login', '/register']
|
|
49
|
-
*/
|
|
50
|
-
guestOnlyRoutes?: string[];
|
|
51
|
-
/**
|
|
52
|
-
* Enable development mode (shows debug info)
|
|
53
|
-
* @default false
|
|
54
|
-
*/
|
|
55
|
-
devMode?: boolean;
|
|
56
|
-
/**
|
|
57
|
-
* Support email address for contact links
|
|
58
|
-
* @optional
|
|
59
|
-
*/
|
|
60
|
-
supportEmail?: string;
|
|
61
|
-
/**
|
|
62
|
-
* Automatically import CSS styles
|
|
63
|
-
* Set to false if you want to manually import styles or use custom styling
|
|
64
|
-
* @default true
|
|
65
|
-
*/
|
|
66
|
-
styles?: boolean;
|
|
67
|
-
}
|
|
1
|
+
import { StrandsAuthConfig } from '../types';
|
|
2
|
+
export type { StrandsAuthConfig, StrandsAuthEndpoints } from '../types';
|
|
68
3
|
declare const _default: import('@nuxt/schema').NuxtModule<StrandsAuthConfig, StrandsAuthConfig, false>;
|
|
69
4
|
export default _default;
|
|
70
5
|
//# sourceMappingURL=module.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../apps/accounts-ui/src/nuxt-v4/module.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../apps/accounts-ui/src/nuxt-v4/module.ts"],"names":[],"mappings":"AAGA,YAAY,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AACvE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;;AAEjD,wBAiIE"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineNuxtModule as
|
|
2
|
-
const
|
|
1
|
+
import { defineNuxtModule as p, createResolver as h, addPlugin as i, addRouteMiddleware as g, addImports as S, addComponent as f } from "@nuxt/kit";
|
|
2
|
+
const v = p({
|
|
3
3
|
meta: {
|
|
4
4
|
name: "@strands.gg/accui/nuxt-v4",
|
|
5
5
|
configKey: "strandsAuth",
|
|
@@ -20,55 +20,43 @@ const S = i({
|
|
|
20
20
|
devMode: !1,
|
|
21
21
|
styles: !0
|
|
22
22
|
},
|
|
23
|
-
async setup(
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
accentColor: e.accentColor,
|
|
30
|
-
redirectUrl: e.redirectUrl,
|
|
31
|
-
onSignInUrl: e.onSignInUrl,
|
|
32
|
-
onSignOutUrl: e.onSignOutUrl,
|
|
33
|
-
autoRefresh: e.autoRefresh,
|
|
34
|
-
refreshInterval: e.refreshInterval,
|
|
35
|
-
protectedRoutes: e.protectedRoutes,
|
|
36
|
-
guestOnlyRoutes: e.guestOnlyRoutes,
|
|
37
|
-
devMode: e.devMode,
|
|
38
|
-
styles: e.styles !== !1,
|
|
39
|
-
// Default to true, allow disabling
|
|
40
|
-
supportEmail: e.supportEmail
|
|
23
|
+
async setup(o, t) {
|
|
24
|
+
const e = h(import.meta.url);
|
|
25
|
+
t.options.runtimeConfig.public = t.options.runtimeConfig.public || {};
|
|
26
|
+
const a = {
|
|
27
|
+
...o,
|
|
28
|
+
styles: o.styles !== !1
|
|
41
29
|
};
|
|
42
|
-
|
|
43
|
-
const u =
|
|
44
|
-
|
|
45
|
-
src:
|
|
30
|
+
t.options.runtimeConfig.public.strandsAuth = a, t.options.appConfig.strandsAuth = a, o.styles !== !1 && t.options.css.push("@strands.gg/accui/style.css");
|
|
31
|
+
const u = process.env.NODE_ENV === "development", s = u ? "ts" : "es.js", l = e.resolve(`./runtime/plugin.client.${s}`), d = e.resolve(`./runtime/plugin.server.${s}`), c = e.resolve(`./runtime/middleware/auth.global.${s}`);
|
|
32
|
+
i({
|
|
33
|
+
src: l,
|
|
46
34
|
mode: "client"
|
|
47
|
-
}),
|
|
48
|
-
src:
|
|
35
|
+
}), i({
|
|
36
|
+
src: d,
|
|
49
37
|
mode: "server"
|
|
50
|
-
}),
|
|
38
|
+
}), g({
|
|
51
39
|
name: "auth",
|
|
52
|
-
path:
|
|
40
|
+
path: c,
|
|
53
41
|
global: !0
|
|
54
|
-
}),
|
|
42
|
+
}), S([
|
|
55
43
|
{
|
|
56
44
|
name: "useStrandsAuth",
|
|
57
45
|
as: "useStrandsAuth",
|
|
58
|
-
from:
|
|
46
|
+
from: e.resolve(`./runtime/composables/useStrandsAuth.${s}`)
|
|
59
47
|
},
|
|
60
48
|
{
|
|
61
49
|
name: "useAuthUser",
|
|
62
50
|
as: "useAuthUser",
|
|
63
|
-
from:
|
|
51
|
+
from: e.resolve(`./runtime/composables/useStrandsAuth.${s}`)
|
|
64
52
|
},
|
|
65
53
|
{
|
|
66
54
|
name: "useAuthState",
|
|
67
55
|
as: "useAuthState",
|
|
68
|
-
from:
|
|
56
|
+
from: e.resolve(`./runtime/composables/useStrandsAuth.${s}`)
|
|
69
57
|
}
|
|
70
58
|
]);
|
|
71
|
-
const
|
|
59
|
+
const m = [
|
|
72
60
|
"StrandsAuth",
|
|
73
61
|
"StrandsSignIn",
|
|
74
62
|
"StrandsSignUp",
|
|
@@ -82,26 +70,28 @@ const S = i({
|
|
|
82
70
|
"StrandsLogo",
|
|
83
71
|
"StrandsSecuredFooter"
|
|
84
72
|
];
|
|
85
|
-
for (const r of
|
|
86
|
-
|
|
73
|
+
for (const r of m)
|
|
74
|
+
f({
|
|
87
75
|
name: r,
|
|
88
76
|
export: r,
|
|
89
77
|
filePath: "@strands.gg/accui"
|
|
90
78
|
});
|
|
91
|
-
|
|
79
|
+
t.hook("prepare:types", (r) => {
|
|
92
80
|
r.references.push({
|
|
93
81
|
types: "@strands.gg/auth-nuxt-v4"
|
|
94
|
-
})
|
|
82
|
+
});
|
|
83
|
+
const n = u ? "ts" : "d.ts";
|
|
84
|
+
r.declarations.push(`
|
|
95
85
|
declare global {
|
|
96
|
-
const useStrandsAuth: typeof import('${
|
|
97
|
-
const useAuthUser: typeof import('${
|
|
98
|
-
const useAuthState: typeof import('${
|
|
86
|
+
const useStrandsAuth: typeof import('${e.resolve(`./runtime/composables/useStrandsAuth.${n}`)}')['useStrandsAuth']
|
|
87
|
+
const useAuthUser: typeof import('${e.resolve(`./runtime/composables/useStrandsAuth.${n}`)}')['useAuthUser']
|
|
88
|
+
const useAuthState: typeof import('${e.resolve(`./runtime/composables/useStrandsAuth.${n}`)}')['useAuthState']
|
|
99
89
|
}
|
|
100
90
|
`);
|
|
101
91
|
});
|
|
102
92
|
}
|
|
103
93
|
});
|
|
104
94
|
export {
|
|
105
|
-
|
|
95
|
+
v as default
|
|
106
96
|
};
|
|
107
97
|
//# sourceMappingURL=module.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.es.js","sources":["../../../../apps/accounts-ui/src/nuxt-v4/module.ts"],"sourcesContent":["import { defineNuxtModule, addPlugin, createResolver, addImports, addComponent, addRouteMiddleware } from '@nuxt/kit'\n\
|
|
1
|
+
{"version":3,"file":"module.es.js","sources":["../../../../apps/accounts-ui/src/nuxt-v4/module.ts"],"sourcesContent":["import { defineNuxtModule, addPlugin, createResolver, addImports, addComponent, addRouteMiddleware } from '@nuxt/kit'\n\n// Re-export types for users\nexport type { StrandsAuthConfig, StrandsAuthEndpoints } from '../types'\nimport type { StrandsAuthConfig } from '../types'\n\nexport default defineNuxtModule<StrandsAuthConfig>({\n meta: {\n name: '@strands.gg/accui/nuxt-v4',\n configKey: 'strandsAuth',\n compatibility: {\n nuxt: '^4.0.0'\n }\n },\n defaults: {\n baseUrl: 'https://your-api.example.com',\n accentColor: '#EA00A8',\n redirectUrl: '/',\n onSignInUrl: '/dashboard',\n onSignOutUrl: '/',\n autoRefresh: true,\n refreshInterval: 4,\n protectedRoutes: [],\n guestOnlyRoutes: ['/auth', '/login', '/register'],\n devMode: false,\n styles: true\n },\n async setup(options, nuxt) {\n const resolver = createResolver(import.meta.url)\n\n // Add runtime config\n nuxt.options.runtimeConfig.public = nuxt.options.runtimeConfig.public || {}\n const runtimeConfig = {\n ...options,\n styles: options.styles !== false\n }\n \n ;(nuxt.options.runtimeConfig.public as any).strandsAuth = runtimeConfig\n \n // Also add it to app config for immediate access\n ;(nuxt.options.appConfig as any).strandsAuth = runtimeConfig\n\n // Conditionally add CSS for styling based on autoImportStyles setting\n if (options.styles !== false) {\n nuxt.options.css.push('@strands.gg/accui/style.css')\n }\n\n // Plugin and middleware paths - use TypeScript in development, JavaScript in production\n // Detect if we're in development (source files exist) or production (built files)\n const isDev = process.env['NODE_ENV'] === 'development'\n const ext = isDev ? 'ts' : 'es.js'\n \n const clientPluginPath = resolver.resolve(`./runtime/plugin.client.${ext}`)\n const serverPluginPath = resolver.resolve(`./runtime/plugin.server.${ext}`) \n const middlewarePath = resolver.resolve(`./runtime/middleware/auth.global.${ext}`)\n\n // Add the main plugin with highest priority to ensure config is set early\n addPlugin({\n src: clientPluginPath,\n mode: 'client'\n })\n\n // Add server plugin for SSR support \n addPlugin({\n src: serverPluginPath,\n mode: 'server'\n })\n\n // Add middleware for route protection (updated for Nuxt v4)\n addRouteMiddleware({\n name: 'auth',\n path: middlewarePath,\n global: true\n })\n\n // Auto-import composables - use TypeScript in development, JavaScript in production\n addImports([\n {\n name: 'useStrandsAuth',\n as: 'useStrandsAuth',\n from: resolver.resolve(`./runtime/composables/useStrandsAuth.${ext}`)\n },\n {\n name: 'useAuthUser',\n as: 'useAuthUser', \n from: resolver.resolve(`./runtime/composables/useStrandsAuth.${ext}`)\n },\n {\n name: 'useAuthState',\n as: 'useAuthState',\n from: resolver.resolve(`./runtime/composables/useStrandsAuth.${ext}`)\n }\n ])\n\n // Auto-register components from the main bundle export\n const components = [\n 'StrandsAuth',\n 'StrandsSignIn', \n 'StrandsSignUp',\n 'StrandsCompleteSignUp',\n 'StrandsUserProfile',\n 'StrandsPasswordReset',\n 'StrandsMFASetup',\n 'StrandsConfigProvider',\n 'SignedIn',\n 'SignedOut',\n 'StrandsLogo',\n 'StrandsSecuredFooter'\n ]\n\n for (const component of components) {\n addComponent({\n name: component,\n export: component,\n filePath: '@strands.gg/accui'\n })\n }\n\n // Add type declarations (updated for Nuxt v4)\n nuxt.hook('prepare:types', (opts) => {\n opts.references.push({\n types: '@strands.gg/auth-nuxt-v4'\n })\n \n // Add the composables to the auto-imports types\n const typeExt = isDev ? 'ts' : 'd.ts'\n opts.declarations.push(`\n declare global {\n const useStrandsAuth: typeof import('${resolver.resolve(`./runtime/composables/useStrandsAuth.${typeExt}`)}')['useStrandsAuth']\n const useAuthUser: typeof import('${resolver.resolve(`./runtime/composables/useStrandsAuth.${typeExt}`)}')['useAuthUser']\n const useAuthState: typeof import('${resolver.resolve(`./runtime/composables/useStrandsAuth.${typeExt}`)}')['useAuthState']\n }\n `)\n })\n }\n})\n"],"names":["module","defineNuxtModule","options","nuxt","resolver","createResolver","runtimeConfig","isDev","ext","clientPluginPath","serverPluginPath","middlewarePath","addPlugin","addRouteMiddleware","addImports","components","component","addComponent","opts","typeExt"],"mappings":";AAMA,MAAAA,IAAeC,EAAoC;AAAA,EACjD,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,WAAW;AAAA,IACX,eAAe;AAAA,MACb,MAAM;AAAA,IAAA;AAAA,EACR;AAAA,EAEF,UAAU;AAAA,IACR,SAAS;AAAA,IACT,aAAa;AAAA,IACb,aAAa;AAAA,IACb,aAAa;AAAA,IACb,cAAc;AAAA,IACd,aAAa;AAAA,IACb,iBAAiB;AAAA,IACjB,iBAAiB,CAAA;AAAA,IACjB,iBAAiB,CAAC,SAAS,UAAU,WAAW;AAAA,IAChD,SAAS;AAAA,IACT,QAAQ;AAAA,EAAA;AAAA,EAEV,MAAM,MAAMC,GAASC,GAAM;AACzB,UAAMC,IAAWC,EAAe,YAAY,GAAG;AAG/C,IAAAF,EAAK,QAAQ,cAAc,SAASA,EAAK,QAAQ,cAAc,UAAU,CAAA;AACzE,UAAMG,IAAgB;AAAA,MACpB,GAAGJ;AAAA,MACH,QAAQA,EAAQ,WAAW;AAAA,IAAA;AAG3B,IAAAC,EAAK,QAAQ,cAAc,OAAe,cAAcG,GAGxDH,EAAK,QAAQ,UAAkB,cAAcG,GAG3CJ,EAAQ,WAAW,MACrBC,EAAK,QAAQ,IAAI,KAAK,6BAA6B;AAKrD,UAAMI,IAAQ,QAAQ,IAAI,aAAgB,eACpCC,IAAMD,IAAQ,OAAO,SAErBE,IAAmBL,EAAS,QAAQ,2BAA2BI,CAAG,EAAE,GACpEE,IAAmBN,EAAS,QAAQ,2BAA2BI,CAAG,EAAE,GACpEG,IAAiBP,EAAS,QAAQ,oCAAoCI,CAAG,EAAE;AAGjF,IAAAI,EAAU;AAAA,MACR,KAAKH;AAAA,MACL,MAAM;AAAA,IAAA,CACP,GAGDG,EAAU;AAAA,MACR,KAAKF;AAAA,MACL,MAAM;AAAA,IAAA,CACP,GAGDG,EAAmB;AAAA,MACjB,MAAM;AAAA,MACN,MAAMF;AAAA,MACN,QAAQ;AAAA,IAAA,CACT,GAGDG,EAAW;AAAA,MACT;AAAA,QACE,MAAM;AAAA,QACN,IAAI;AAAA,QACJ,MAAMV,EAAS,QAAQ,wCAAwCI,CAAG,EAAE;AAAA,MAAA;AAAA,MAEtE;AAAA,QACE,MAAM;AAAA,QACN,IAAI;AAAA,QACJ,MAAMJ,EAAS,QAAQ,wCAAwCI,CAAG,EAAE;AAAA,MAAA;AAAA,MAEtE;AAAA,QACE,MAAM;AAAA,QACN,IAAI;AAAA,QACJ,MAAMJ,EAAS,QAAQ,wCAAwCI,CAAG,EAAE;AAAA,MAAA;AAAA,IACtE,CACD;AAGD,UAAMO,IAAa;AAAA,MACjB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IAAA;AAGF,eAAWC,KAAaD;AACtB,MAAAE,EAAa;AAAA,QACX,MAAMD;AAAA,QACN,QAAQA;AAAA,QACR,UAAU;AAAA,MAAA,CACX;AAIH,IAAAb,EAAK,KAAK,iBAAiB,CAACe,MAAS;AACnC,MAAAA,EAAK,WAAW,KAAK;AAAA,QACnB,OAAO;AAAA,MAAA,CACR;AAGD,YAAMC,IAAUZ,IAAQ,OAAO;AAC/B,MAAAW,EAAK,aAAa,KAAK;AAAA;AAAA,iDAEoBd,EAAS,QAAQ,wCAAwCe,CAAO,EAAE,CAAC;AAAA,8CACtEf,EAAS,QAAQ,wCAAwCe,CAAO,EAAE,CAAC;AAAA,+CAClEf,EAAS,QAAQ,wCAAwCe,CAAO,EAAE,CAAC;AAAA;AAAA,OAE3G;AAAA,IACH,CAAC;AAAA,EACH;AACF,CAAC;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("nuxt/app"),l=require("../../../useStrandsAuth-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("nuxt/app"),l=require("../../../useStrandsAuth-C_MiRZbU.cjs"),r=()=>{const n=i.useRuntimeConfig().public.strandsAuth,t=l.useStrandsAuth(),a=async()=>{try{await t.initialize()}catch(e){console.warn("[Strands Auth v4] Initialize failed:",e)}},u=async e=>{const s=await t.signIn(e);return s&&n.onSignInUrl&&await i.navigateTo(n.onSignInUrl),s},o=async e=>await t.signUp({email:e.email,password:"",firstName:"",lastName:""}),c=async()=>{await t.signOut(),n.onSignOutUrl&&await i.navigateTo(n.onSignOutUrl)};return{user:t.user,currentUser:t.currentUser,currentSession:t.currentSession,isAuthenticated:t.isAuthenticated,isLoading:t.isLoading,loading:t.loading,signIn:u,signUp:o,signOut:c,refreshToken:t.refreshToken,updateProfile:t.updateProfile,setAuthData:t.setAuthData,initialize:a}},g=()=>{const{user:n}=r();return{user:n}},d=()=>{const{isAuthenticated:n,isLoading:t}=r();return{isAuthenticated:n,isLoading:t}};exports.useAuthState=d;exports.useAuthUser=g;exports.useStrandsAuth=r;
|
|
2
2
|
//# sourceMappingURL=useStrandsAuth.cjs.js.map
|
|
@@ -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 '
|
|
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<void>\n updateProfile: (profileData: Partial<User>) => Promise<void>\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","vueAuth","useVueStrandsAuth","initialize","error","signIn","credentials","result","navigateTo","signUp","userData","signOut","useAuthUser","user","useAuthState","isAuthenticated","isLoading"],"mappings":"8JAwBaA,EAAiB,IAAyB,CACrD,MAAMC,EAASC,EAAAA,mBAAmB,OAAO,YAGnCC,EAAUC,EAAAA,eAAA,EAGVC,EAAa,SAAY,CAC7B,GAAI,CACF,MAAMF,EAAQ,WAAA,CAChB,OAASG,EAAO,CACd,QAAQ,KAAK,uCAAwCA,CAAK,CAC5D,CACF,EAGMC,EAAS,MAAOC,GAAqD,CACzE,MAAMC,EAAS,MAAMN,EAAQ,OAAOK,CAAW,EAG/C,OAAIC,GAAUR,EAAO,aACnB,MAAMS,EAAAA,WAAWT,EAAO,WAAW,EAG9BQ,CACT,EAGME,EAAS,MAAOC,GAEL,MAAMT,EAAQ,OAAO,CAClC,MAAOS,EAAS,MAChB,SAAU,GACV,UAAW,GACX,SAAU,EAAA,CACX,EASGC,EAAU,SAAY,CAC1B,MAAMV,EAAQ,QAAA,EAGVF,EAAO,cACT,MAAMS,EAAAA,WAAWT,EAAO,YAAY,CAExC,EAEA,MAAO,CAEL,KAAME,EAAQ,KACd,YAAaA,EAAQ,YACrB,eAAgBA,EAAQ,eACxB,gBAAiBA,EAAQ,gBACzB,UAAWA,EAAQ,UACnB,QAASA,EAAQ,QAGjB,OAAAI,EACA,OAAAI,EACA,QAAAE,EAGA,aAAcV,EAAQ,aACtB,cAAeA,EAAQ,cACvB,YAAaA,EAAQ,YAGrB,WAAAE,CAAA,CAEJ,EAGaS,EAAc,IAA0C,CACnE,KAAM,CAAE,KAAAC,CAAA,EAASf,EAAA,EACjB,MAAO,CAAE,KAAAe,CAAA,CACX,EAEaC,EAAe,IAAkF,CAC5G,KAAM,CAAE,gBAAAC,EAAiB,UAAAC,CAAA,EAAclB,EAAA,EACvC,MAAO,CAAE,gBAAAiB,EAAiB,UAAAC,CAAA,CAC5B"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useRuntimeConfig as l, navigateTo as i } from "nuxt/app";
|
|
2
|
-
import { u as g } from "../../../useStrandsAuth-
|
|
2
|
+
import { u as g } from "../../../useStrandsAuth-CPyy4tH6.js";
|
|
3
3
|
const r = () => {
|
|
4
4
|
const n = l().public.strandsAuth, t = g(), a = async () => {
|
|
5
5
|
try {
|
|
@@ -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 '
|
|
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<void>\n updateProfile: (profileData: Partial<User>) => Promise<void>\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","vueAuth","useVueStrandsAuth","initialize","error","signIn","credentials","result","navigateTo","signUp","userData","signOut","useAuthUser","user","useAuthState","isAuthenticated","isLoading"],"mappings":";;AAwBO,MAAMA,IAAiB,MAAyB;AACrD,QAAMC,IAASC,IAAmB,OAAO,aAGnCC,IAAUC,EAAA,GAGVC,IAAa,YAAY;AAC7B,QAAI;AACF,YAAMF,EAAQ,WAAA;AAAA,IAChB,SAASG,GAAO;AACd,cAAQ,KAAK,wCAAwCA,CAAK;AAAA,IAC5D;AAAA,EACF,GAGMC,IAAS,OAAOC,MAAqD;AACzE,UAAMC,IAAS,MAAMN,EAAQ,OAAOK,CAAW;AAG/C,WAAIC,KAAUR,EAAO,eACnB,MAAMS,EAAWT,EAAO,WAAW,GAG9BQ;AAAA,EACT,GAGME,IAAS,OAAOC,MAEL,MAAMT,EAAQ,OAAO;AAAA,IAClC,OAAOS,EAAS;AAAA,IAChB,UAAU;AAAA;AAAA,IACV,WAAW;AAAA;AAAA,IACX,UAAU;AAAA,EAAA,CACX,GASGC,IAAU,YAAY;AAC1B,UAAMV,EAAQ,QAAA,GAGVF,EAAO,gBACT,MAAMS,EAAWT,EAAO,YAAY;AAAA,EAExC;AAEA,SAAO;AAAA;AAAA,IAEL,MAAME,EAAQ;AAAA,IACd,aAAaA,EAAQ;AAAA,IACrB,gBAAgBA,EAAQ;AAAA,IACxB,iBAAiBA,EAAQ;AAAA,IACzB,WAAWA,EAAQ;AAAA,IACnB,SAASA,EAAQ;AAAA;AAAA,IAGjB,QAAAI;AAAA,IACA,QAAAI;AAAA,IACA,SAAAE;AAAA;AAAA,IAGA,cAAcV,EAAQ;AAAA,IACtB,eAAeA,EAAQ;AAAA,IACvB,aAAaA,EAAQ;AAAA;AAAA,IAGrB,YAAAE;AAAA,EAAA;AAEJ,GAGaS,IAAc,MAA0C;AACnE,QAAM,EAAE,MAAAC,EAAA,IAASf,EAAA;AACjB,SAAO,EAAE,MAAAe,EAAA;AACX,GAEaC,IAAe,MAAkF;AAC5G,QAAM,EAAE,iBAAAC,GAAiB,WAAAC,EAAA,IAAclB,EAAA;AACvC,SAAO,EAAE,iBAAAiB,GAAiB,WAAAC,EAAA;AAC5B;"}
|