@strands.gg/accui 0.2.2 → 0.2.3
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/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 +15 -21
- package/dist/nuxt/runtime/composables/useStrandsAuth.d.ts.map +1 -1
- package/dist/nuxt/runtime/composables/useStrandsAuth.es.js +2 -2
- package/dist/nuxt/runtime/composables/useStrandsAuth.es.js.map +1 -1
- package/dist/nuxt/runtime/plugin.client.cjs.js +1 -1
- package/dist/nuxt/runtime/plugin.client.es.js +1 -1
- package/dist/nuxt-v4/module.cjs.js +7 -1
- package/dist/nuxt-v4/module.cjs.js.map +1 -1
- package/dist/nuxt-v4/module.d.ts +5 -0
- package/dist/nuxt-v4/module.d.ts.map +1 -1
- package/dist/nuxt-v4/module.es.js +27 -18
- 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.d.ts +21 -59
- package/dist/nuxt-v4/runtime/composables/useStrandsAuth.d.ts.map +1 -1
- package/dist/nuxt-v4/runtime/composables/useStrandsAuth.es.js +45 -36
- package/dist/nuxt-v4/runtime/composables/useStrandsAuth.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 +23 -12
- package/dist/nuxt-v4/runtime/plugin.client.es.js.map +1 -1
- package/dist/nuxt-v4/types.d.ts +2 -2
- package/dist/nuxt-v4/types.d.ts.map +1 -1
- package/dist/nuxt-v4.d.ts +1 -0
- package/dist/nuxt-v4.d.ts.map +1 -1
- package/dist/strands-auth-ui.cjs.js +1 -1
- package/dist/strands-auth-ui.cjs.js.map +1 -1
- package/dist/strands-auth-ui.es.js +1468 -1315
- package/dist/strands-auth-ui.es.js.map +1 -1
- package/dist/types/index.d.ts +5 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/useStrandsAuth-BGunGG2x.cjs +2 -0
- package/dist/useStrandsAuth-BGunGG2x.cjs.map +1 -0
- package/dist/useStrandsAuth-DiD32KI7.js +91 -0
- package/dist/useStrandsAuth-DiD32KI7.js.map +1 -0
- package/dist/useStrandsConfig-CtzCmeS1.js +105 -0
- package/dist/useStrandsConfig-CtzCmeS1.js.map +1 -0
- package/dist/useStrandsConfig-DamqmMUO.cjs +2 -0
- package/dist/useStrandsConfig-DamqmMUO.cjs.map +1 -0
- package/dist/vue/components/StrandsAuth.vue.d.ts.map +1 -1
- package/dist/vue/components/StrandsCompleteSignUp.vue.d.ts.map +1 -1
- package/dist/vue/components/StrandsPasswordReset.vue.d.ts +7 -3
- package/dist/vue/components/StrandsPasswordReset.vue.d.ts.map +1 -1
- package/dist/vue/components/StrandsSecuredFooter.vue.d.ts +5 -1
- package/dist/vue/components/StrandsSecuredFooter.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 +2 -0
- package/dist/vue/components/StrandsUserProfile.vue.d.ts.map +1 -1
- package/dist/vue/composables/useStrandsAuth.d.ts +2 -1
- package/dist/vue/composables/useStrandsAuth.d.ts.map +1 -1
- package/dist/vue/composables/useStrandsConfig.d.ts +2 -0
- package/dist/vue/composables/useStrandsConfig.d.ts.map +1 -1
- package/dist/vue/ui/UiInput.vue.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/useStrandsAuth-Bh7evftS.js +0 -66
- package/dist/useStrandsAuth-Bh7evftS.js.map +0 -1
- package/dist/useStrandsAuth-sAfTQeGC.cjs +0 -2
- package/dist/useStrandsAuth-sAfTQeGC.cjs.map +0 -1
- package/dist/useStrandsConfig-BYwF65Ph.js +0 -89
- package/dist/useStrandsConfig-BYwF65Ph.js.map +0 -1
- package/dist/useStrandsConfig-Bhbfl0PJ.cjs +0 -2
- package/dist/useStrandsConfig-Bhbfl0PJ.cjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useStrandsAuth.cjs.js","sources":["../../../../../../apps/accounts-ui/src/nuxt-v4/runtime/composables/useStrandsAuth.ts"],"sourcesContent":["import type { Ref } from 'vue'\nimport { useRuntimeConfig } from 'nuxt/app'\nimport { navigateTo } from 'nuxt/app'\nimport { useStrandsAuth as useVueStrandsAuth } from '../../../vue/composables/useStrandsAuth'\nimport type { StrandsAuthConfig } from '../../module'\n\nexport const useStrandsAuth = () => {\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\n
|
|
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 '../../module'\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,65 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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>;
|
|
10
12
|
signOut: () => Promise<void>;
|
|
11
|
-
user: import('vue').ComputedRef<{
|
|
12
|
-
id: string;
|
|
13
|
-
email: string;
|
|
14
|
-
firstName: string;
|
|
15
|
-
lastName: string;
|
|
16
|
-
phone?: string | undefined;
|
|
17
|
-
avatar?: string | undefined;
|
|
18
|
-
mfaEnabled: boolean;
|
|
19
|
-
emailVerified: boolean;
|
|
20
|
-
createdAt: string | Date;
|
|
21
|
-
updatedAt: string | Date;
|
|
22
|
-
} | null>;
|
|
23
|
-
currentUser: import('vue').ComputedRef<{
|
|
24
|
-
id: string;
|
|
25
|
-
email: string;
|
|
26
|
-
firstName: string;
|
|
27
|
-
lastName: string;
|
|
28
|
-
phone?: string | undefined;
|
|
29
|
-
avatar?: string | undefined;
|
|
30
|
-
mfaEnabled: boolean;
|
|
31
|
-
emailVerified: boolean;
|
|
32
|
-
createdAt: string | Date;
|
|
33
|
-
updatedAt: string | Date;
|
|
34
|
-
} | null>;
|
|
35
|
-
currentSession: import('vue').ComputedRef<{
|
|
36
|
-
id?: string | undefined;
|
|
37
|
-
userId?: string | undefined;
|
|
38
|
-
accessToken: string;
|
|
39
|
-
refreshToken: string;
|
|
40
|
-
expiresAt: Date;
|
|
41
|
-
createdAt?: Date | undefined;
|
|
42
|
-
} | null>;
|
|
43
|
-
isAuthenticated: import('vue').ComputedRef<boolean>;
|
|
44
|
-
isLoading: import('vue').ComputedRef<boolean>;
|
|
45
|
-
loading: import('vue').ComputedRef<boolean>;
|
|
46
13
|
refreshToken: () => Promise<void>;
|
|
47
|
-
updateProfile: (profileData: Partial<
|
|
14
|
+
updateProfile: (profileData: Partial<User>) => Promise<void>;
|
|
15
|
+
setAuthData: (authResponse: AuthResponse) => void;
|
|
16
|
+
initialize: () => Promise<void>;
|
|
17
|
+
}
|
|
18
|
+
export declare const useStrandsAuth: () => StrandsAuthReturn;
|
|
19
|
+
export declare const useAuthUser: () => {
|
|
20
|
+
user: ComputedRef<User | null>;
|
|
48
21
|
};
|
|
49
|
-
export declare const useAuthUser: () => import('vue').ComputedRef<{
|
|
50
|
-
id: string;
|
|
51
|
-
email: string;
|
|
52
|
-
firstName: string;
|
|
53
|
-
lastName: string;
|
|
54
|
-
phone?: string | undefined;
|
|
55
|
-
avatar?: string | undefined;
|
|
56
|
-
mfaEnabled: boolean;
|
|
57
|
-
emailVerified: boolean;
|
|
58
|
-
createdAt: string | Date;
|
|
59
|
-
updatedAt: string | Date;
|
|
60
|
-
} | null>;
|
|
61
22
|
export declare const useAuthState: () => {
|
|
62
|
-
isAuthenticated:
|
|
63
|
-
isLoading:
|
|
23
|
+
isAuthenticated: ComputedRef<boolean>;
|
|
24
|
+
isLoading: ComputedRef<boolean>;
|
|
64
25
|
};
|
|
26
|
+
export {};
|
|
65
27
|
//# sourceMappingURL=useStrandsAuth.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useStrandsAuth.d.ts","sourceRoot":"","sources":["../../../../../../apps/accounts-ui/src/nuxt-v4/runtime/composables/useStrandsAuth.ts"],"names":[],"mappings":"
|
|
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,IAAI,CAAC,CAAA;IACjC,aAAa,EAAE,CAAC,WAAW,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IAC5D,WAAW,EAAE,CAAC,YAAY,EAAE,YAAY,KAAK,IAAI,CAAA;IACjD,UAAU,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CAChC;AAED,eAAO,MAAM,cAAc,QAAO,iBA2EjC,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"}
|
|
@@ -1,45 +1,54 @@
|
|
|
1
|
-
import { useRuntimeConfig as
|
|
2
|
-
import { u } from "../../../useStrandsAuth-
|
|
1
|
+
import { useRuntimeConfig as l, navigateTo as i } from "nuxt/app";
|
|
2
|
+
import { u as g } from "../../../useStrandsAuth-DiD32KI7.js";
|
|
3
3
|
const r = () => {
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
initialize: async () => {
|
|
10
|
-
try {
|
|
11
|
-
await n.initialize();
|
|
12
|
-
} catch (i) {
|
|
13
|
-
console.warn("[Strands Auth v4] Initialize failed:", i);
|
|
14
|
-
}
|
|
15
|
-
},
|
|
16
|
-
// Override methods with Nuxt-specific navigation
|
|
17
|
-
signIn: async (i) => {
|
|
18
|
-
const s = await n.signIn(i);
|
|
19
|
-
return s && t.onSignInUrl && await a(t.onSignInUrl), s;
|
|
20
|
-
},
|
|
21
|
-
signUp: async (i) => await n.signUp({
|
|
22
|
-
email: i.email,
|
|
23
|
-
password: "",
|
|
24
|
-
// Empty password for magic link
|
|
25
|
-
firstName: "",
|
|
26
|
-
// Will be filled later in the magic link flow
|
|
27
|
-
lastName: ""
|
|
28
|
-
}),
|
|
29
|
-
signOut: async () => {
|
|
30
|
-
await n.signOut(), t.onSignOutUrl && await a(t.onSignOutUrl);
|
|
4
|
+
const n = l().public.strandsAuth, t = g(), a = async () => {
|
|
5
|
+
try {
|
|
6
|
+
await t.initialize();
|
|
7
|
+
} catch (s) {
|
|
8
|
+
console.warn("[Strands Auth v4] Initialize failed:", s);
|
|
31
9
|
}
|
|
10
|
+
}, u = async (s) => {
|
|
11
|
+
const e = await t.signIn(s);
|
|
12
|
+
return e && n.onSignInUrl && await i(n.onSignInUrl), e;
|
|
13
|
+
}, o = async (s) => await t.signUp({
|
|
14
|
+
email: s.email,
|
|
15
|
+
password: "",
|
|
16
|
+
// Empty password for magic link
|
|
17
|
+
firstName: "",
|
|
18
|
+
// Will be filled later in the magic link flow
|
|
19
|
+
lastName: ""
|
|
20
|
+
}), c = async () => {
|
|
21
|
+
await t.signOut(), n.onSignOutUrl && await i(n.onSignOutUrl);
|
|
22
|
+
};
|
|
23
|
+
return {
|
|
24
|
+
// Re-export Vue composable state and methods with explicit typing
|
|
25
|
+
user: t.user,
|
|
26
|
+
currentUser: t.currentUser,
|
|
27
|
+
currentSession: t.currentSession,
|
|
28
|
+
isAuthenticated: t.isAuthenticated,
|
|
29
|
+
isLoading: t.isLoading,
|
|
30
|
+
loading: t.loading,
|
|
31
|
+
// Methods with Nuxt-specific navigation overrides
|
|
32
|
+
signIn: u,
|
|
33
|
+
signUp: o,
|
|
34
|
+
signOut: c,
|
|
35
|
+
// Other methods from Vue composable
|
|
36
|
+
refreshToken: t.refreshToken,
|
|
37
|
+
updateProfile: t.updateProfile,
|
|
38
|
+
setAuthData: t.setAuthData,
|
|
39
|
+
// Initialize function
|
|
40
|
+
initialize: a
|
|
32
41
|
};
|
|
33
|
-
}, d = () => {
|
|
34
|
-
const { user: t } = r();
|
|
35
|
-
return t;
|
|
36
42
|
}, f = () => {
|
|
37
|
-
const {
|
|
38
|
-
return {
|
|
43
|
+
const { user: n } = r();
|
|
44
|
+
return { user: n };
|
|
45
|
+
}, A = () => {
|
|
46
|
+
const { isAuthenticated: n, isLoading: t } = r();
|
|
47
|
+
return { isAuthenticated: n, isLoading: t };
|
|
39
48
|
};
|
|
40
49
|
export {
|
|
41
|
-
|
|
42
|
-
|
|
50
|
+
A as useAuthState,
|
|
51
|
+
f as useAuthUser,
|
|
43
52
|
r as useStrandsAuth
|
|
44
53
|
};
|
|
45
54
|
//# sourceMappingURL=useStrandsAuth.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useStrandsAuth.es.js","sources":["../../../../../../apps/accounts-ui/src/nuxt-v4/runtime/composables/useStrandsAuth.ts"],"sourcesContent":["import type { Ref } from 'vue'\nimport { useRuntimeConfig } from 'nuxt/app'\nimport { navigateTo } from 'nuxt/app'\nimport { useStrandsAuth as useVueStrandsAuth } from '../../../vue/composables/useStrandsAuth'\nimport type { StrandsAuthConfig } from '../../module'\n\nexport const useStrandsAuth = () => {\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\n
|
|
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 '../../module'\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;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const r=require("nuxt/app"),u=r.defineNuxtPlugin({name:"strands-auth-client-v4",setup(s){console.log("[Strands Auth Plugin] Starting plugin setup");const o=r.useRuntimeConfig(),n=o.public.strandsAuth;if(console.log("[Strands Auth Plugin] Runtime config debug:",{hasRuntimeConfig:!!o,hasPublicConfig:!!o.public,hasStrandsAuth:!!o.public.strandsAuth,strandsConfig:n,fullPublicConfig:o.public}),n&&n.baseUrl)try{const t={baseUrl:n.baseUrl,endpoints:n.endpoints||{},supportEmail:n.supportEmail};console.log("[Strands Auth Plugin] About to set global config:",t),typeof window<"u"&&(window.__STRANDS_CONFIG__=t,console.log("[Strands Auth Plugin] ✅ Set window.__STRANDS_CONFIG__:",t)),Promise.resolve().then(()=>require("../../useStrandsConfig-DamqmMUO.cjs")).then(({setStrandsConfig:e,provideStrandsConfig:l})=>{e(t),console.log("[Strands Auth Plugin] ✅ setStrandsConfig called successfully");try{s.vueApp.runWithContext(()=>{l(t)}),console.log("[Strands Auth Plugin] ✅ provideStrandsConfig called at app level")}catch(i){console.warn("[Strands Auth Plugin] Could not provide at app level (not critical):",i)}}).catch(e=>{console.error("[Strands Auth Plugin] Configuration setup error:",e)}),n.accentColor&&typeof window<"u"&&document.documentElement.style.setProperty("--strands-accent",n.accentColor)}catch(t){console.error("[Strands Auth Plugin] Configuration error:",t)}else console.error("[Strands Auth Plugin] ❌ No baseUrl in strandsAuth config:",n);console.log("[Strands Auth Plugin] Plugin setup completed")}});module.exports=u;
|
|
2
2
|
//# sourceMappingURL=plugin.client.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.client.cjs.js","sources":["../../../../../apps/accounts-ui/src/nuxt-v4/runtime/plugin.client.ts"],"sourcesContent":["import { defineNuxtPlugin, useRuntimeConfig } from 'nuxt/app'\n\nexport default defineNuxtPlugin({\n name: 'strands-auth-client-v4',\n setup(nuxtApp) {\n console.log('[Strands Auth Plugin] Starting plugin setup')\n \n // Get runtime config\n const config = useRuntimeConfig()\n const strandsConfig = config.public.strandsAuth as any\n \n console.log('[Strands Auth Plugin] Runtime config:', {\n hasStrandsAuth: !!config.public.strandsAuth,\n strandsConfig: strandsConfig\n })\n \n if (strandsConfig && strandsConfig.baseUrl) {\n try {\n const configToProvide = {\n baseUrl: strandsConfig.baseUrl,\n endpoints: strandsConfig.endpoints || {}\n }\n \n console.log('[Strands Auth Plugin] About to set global config:', configToProvide)\n \n // Set global config synchronously by setting window global\n if (typeof window !== 'undefined') {\n ;(window as any).__STRANDS_CONFIG__ = configToProvide\n console.log('[Strands Auth Plugin] ✅ Set window.__STRANDS_CONFIG__:', configToProvide)\n }\n
|
|
1
|
+
{"version":3,"file":"plugin.client.cjs.js","sources":["../../../../../apps/accounts-ui/src/nuxt-v4/runtime/plugin.client.ts"],"sourcesContent":["import { defineNuxtPlugin, useRuntimeConfig } from 'nuxt/app'\n\nexport default defineNuxtPlugin({\n name: 'strands-auth-client-v4',\n setup(nuxtApp) {\n console.log('[Strands Auth Plugin] Starting plugin setup')\n \n // Get runtime config\n const config = useRuntimeConfig()\n const strandsConfig = config.public.strandsAuth as any\n \n console.log('[Strands Auth Plugin] Runtime config debug:', {\n hasRuntimeConfig: !!config,\n hasPublicConfig: !!config.public,\n hasStrandsAuth: !!config.public.strandsAuth,\n strandsConfig: strandsConfig,\n fullPublicConfig: config.public\n })\n \n if (strandsConfig && strandsConfig.baseUrl) {\n try {\n const configToProvide = {\n baseUrl: strandsConfig.baseUrl,\n endpoints: strandsConfig.endpoints || {},\n supportEmail: strandsConfig.supportEmail\n }\n \n console.log('[Strands Auth Plugin] About to set global config:', configToProvide)\n \n // Set global config synchronously by setting window global\n if (typeof window !== 'undefined') {\n ;(window as any).__STRANDS_CONFIG__ = configToProvide\n console.log('[Strands Auth Plugin] ✅ Set window.__STRANDS_CONFIG__:', configToProvide)\n }\n\n // Import and set config synchronously\n import('../../vue/composables/useStrandsConfig').then(({ setStrandsConfig, provideStrandsConfig }) => {\n // Set global config\n setStrandsConfig(configToProvide)\n console.log('[Strands Auth Plugin] ✅ setStrandsConfig called successfully')\n \n // Try to provide at app level (may not work in all contexts)\n try {\n nuxtApp.vueApp.runWithContext(() => {\n provideStrandsConfig(configToProvide)\n })\n console.log('[Strands Auth Plugin] ✅ provideStrandsConfig called at app level')\n } catch (provideError) {\n console.warn('[Strands Auth Plugin] Could not provide at app level (not critical):', provideError)\n }\n }).catch(error => {\n console.error('[Strands Auth Plugin] Configuration setup error:', error)\n })\n \n // Set CSS accent color if provided\n if (strandsConfig.accentColor && typeof window !== 'undefined') {\n document.documentElement.style.setProperty('--strands-accent', strandsConfig.accentColor)\n }\n \n } catch (error) {\n console.error('[Strands Auth Plugin] Configuration error:', error)\n }\n } else {\n console.error('[Strands Auth Plugin] ❌ No baseUrl in strandsAuth config:', strandsConfig)\n }\n \n console.log('[Strands Auth Plugin] Plugin setup completed')\n }\n})\n"],"names":["plugin_client","defineNuxtPlugin","nuxtApp","config","useRuntimeConfig","strandsConfig","configToProvide","setStrandsConfig","provideStrandsConfig","provideError","error"],"mappings":"yCAEAA,EAAeC,mBAAiB,CAC9B,KAAM,yBACN,MAAMC,EAAS,CACb,QAAQ,IAAI,6CAA6C,EAGzD,MAAMC,EAASC,EAAAA,iBAAA,EACTC,EAAgBF,EAAO,OAAO,YAUpC,GARA,QAAQ,IAAI,8CAA+C,CACzD,iBAAkB,CAAC,CAACA,EACpB,gBAAiB,CAAC,CAACA,EAAO,OAC1B,eAAgB,CAAC,CAACA,EAAO,OAAO,YAChC,cAAAE,EACA,iBAAkBF,EAAO,MAAA,CAC1B,EAEGE,GAAiBA,EAAc,QACjC,GAAI,CACF,MAAMC,EAAkB,CACtB,QAASD,EAAc,QACvB,UAAWA,EAAc,WAAa,CAAA,EACtC,aAAcA,EAAc,YAAA,EAG9B,QAAQ,IAAI,oDAAqDC,CAAe,EAG5E,OAAO,OAAW,MAClB,OAAe,mBAAqBA,EACtC,QAAQ,IAAI,yDAA0DA,CAAe,GAIvF,QAAA,QAAA,EAAA,KAAA,IAAA,QAAO,qCAAwC,CAAA,EAAE,KAAK,CAAC,CAAE,iBAAAC,EAAkB,qBAAAC,KAA2B,CAEpGD,EAAiBD,CAAe,EAChC,QAAQ,IAAI,8DAA8D,EAG1E,GAAI,CACFJ,EAAQ,OAAO,eAAe,IAAM,CAClCM,EAAqBF,CAAe,CACtC,CAAC,EACD,QAAQ,IAAI,kEAAkE,CAChF,OAASG,EAAc,CACrB,QAAQ,KAAK,uEAAwEA,CAAY,CACnG,CACF,CAAC,EAAE,MAAMC,GAAS,CAChB,QAAQ,MAAM,mDAAoDA,CAAK,CACzE,CAAC,EAGGL,EAAc,aAAe,OAAO,OAAW,KACjD,SAAS,gBAAgB,MAAM,YAAY,mBAAoBA,EAAc,WAAW,CAG5F,OAASK,EAAO,CACd,QAAQ,MAAM,6CAA8CA,CAAK,CACnE,MAEA,QAAQ,MAAM,4DAA6DL,CAAa,EAG1F,QAAQ,IAAI,8CAA8C,CAC5D,CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.client.d.ts","sourceRoot":"","sources":["../../../../../apps/accounts-ui/src/nuxt-v4/runtime/plugin.client.ts"],"names":[],"mappings":";AAEA,
|
|
1
|
+
{"version":3,"file":"plugin.client.d.ts","sourceRoot":"","sources":["../../../../../apps/accounts-ui/src/nuxt-v4/runtime/plugin.client.ts"],"names":[],"mappings":";AAEA,wBAkEE"}
|
|
@@ -1,22 +1,33 @@
|
|
|
1
|
-
import { defineNuxtPlugin as s, useRuntimeConfig as
|
|
2
|
-
const
|
|
1
|
+
import { defineNuxtPlugin as s, useRuntimeConfig as u } from "nuxt/app";
|
|
2
|
+
const c = s({
|
|
3
3
|
name: "strands-auth-client-v4",
|
|
4
4
|
setup(l) {
|
|
5
5
|
console.log("[Strands Auth Plugin] Starting plugin setup");
|
|
6
|
-
const
|
|
7
|
-
if (console.log("[Strands Auth Plugin] Runtime config:", {
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
const o = u(), n = o.public.strandsAuth;
|
|
7
|
+
if (console.log("[Strands Auth Plugin] Runtime config debug:", {
|
|
8
|
+
hasRuntimeConfig: !!o,
|
|
9
|
+
hasPublicConfig: !!o.public,
|
|
10
|
+
hasStrandsAuth: !!o.public.strandsAuth,
|
|
11
|
+
strandsConfig: n,
|
|
12
|
+
fullPublicConfig: o.public
|
|
10
13
|
}), n && n.baseUrl)
|
|
11
14
|
try {
|
|
12
15
|
const t = {
|
|
13
16
|
baseUrl: n.baseUrl,
|
|
14
|
-
endpoints: n.endpoints || {}
|
|
17
|
+
endpoints: n.endpoints || {},
|
|
18
|
+
supportEmail: n.supportEmail
|
|
15
19
|
};
|
|
16
|
-
console.log("[Strands Auth Plugin] About to set global config:", t), typeof window < "u" && (window.__STRANDS_CONFIG__ = t, console.log("[Strands Auth Plugin] ✅ Set window.__STRANDS_CONFIG__:", t)), import("../../useStrandsConfig-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
+
console.log("[Strands Auth Plugin] About to set global config:", t), typeof window < "u" && (window.__STRANDS_CONFIG__ = t, console.log("[Strands Auth Plugin] ✅ Set window.__STRANDS_CONFIG__:", t)), import("../../useStrandsConfig-CtzCmeS1.js").then(({ setStrandsConfig: e, provideStrandsConfig: i }) => {
|
|
21
|
+
e(t), console.log("[Strands Auth Plugin] ✅ setStrandsConfig called successfully");
|
|
22
|
+
try {
|
|
23
|
+
l.vueApp.runWithContext(() => {
|
|
24
|
+
i(t);
|
|
25
|
+
}), console.log("[Strands Auth Plugin] ✅ provideStrandsConfig called at app level");
|
|
26
|
+
} catch (r) {
|
|
27
|
+
console.warn("[Strands Auth Plugin] Could not provide at app level (not critical):", r);
|
|
28
|
+
}
|
|
29
|
+
}).catch((e) => {
|
|
30
|
+
console.error("[Strands Auth Plugin] Configuration setup error:", e);
|
|
20
31
|
}), n.accentColor && typeof window < "u" && document.documentElement.style.setProperty("--strands-accent", n.accentColor);
|
|
21
32
|
} catch (t) {
|
|
22
33
|
console.error("[Strands Auth Plugin] Configuration error:", t);
|
|
@@ -27,6 +38,6 @@ const u = s({
|
|
|
27
38
|
}
|
|
28
39
|
});
|
|
29
40
|
export {
|
|
30
|
-
|
|
41
|
+
c as default
|
|
31
42
|
};
|
|
32
43
|
//# sourceMappingURL=plugin.client.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.client.es.js","sources":["../../../../../apps/accounts-ui/src/nuxt-v4/runtime/plugin.client.ts"],"sourcesContent":["import { defineNuxtPlugin, useRuntimeConfig } from 'nuxt/app'\n\nexport default defineNuxtPlugin({\n name: 'strands-auth-client-v4',\n setup(nuxtApp) {\n console.log('[Strands Auth Plugin] Starting plugin setup')\n \n // Get runtime config\n const config = useRuntimeConfig()\n const strandsConfig = config.public.strandsAuth as any\n \n console.log('[Strands Auth Plugin] Runtime config:', {\n hasStrandsAuth: !!config.public.strandsAuth,\n strandsConfig: strandsConfig\n })\n \n if (strandsConfig && strandsConfig.baseUrl) {\n try {\n const configToProvide = {\n baseUrl: strandsConfig.baseUrl,\n endpoints: strandsConfig.endpoints || {}\n }\n \n console.log('[Strands Auth Plugin] About to set global config:', configToProvide)\n \n // Set global config synchronously by setting window global\n if (typeof window !== 'undefined') {\n ;(window as any).__STRANDS_CONFIG__ = configToProvide\n console.log('[Strands Auth Plugin] ✅ Set window.__STRANDS_CONFIG__:', configToProvide)\n }\n
|
|
1
|
+
{"version":3,"file":"plugin.client.es.js","sources":["../../../../../apps/accounts-ui/src/nuxt-v4/runtime/plugin.client.ts"],"sourcesContent":["import { defineNuxtPlugin, useRuntimeConfig } from 'nuxt/app'\n\nexport default defineNuxtPlugin({\n name: 'strands-auth-client-v4',\n setup(nuxtApp) {\n console.log('[Strands Auth Plugin] Starting plugin setup')\n \n // Get runtime config\n const config = useRuntimeConfig()\n const strandsConfig = config.public.strandsAuth as any\n \n console.log('[Strands Auth Plugin] Runtime config debug:', {\n hasRuntimeConfig: !!config,\n hasPublicConfig: !!config.public,\n hasStrandsAuth: !!config.public.strandsAuth,\n strandsConfig: strandsConfig,\n fullPublicConfig: config.public\n })\n \n if (strandsConfig && strandsConfig.baseUrl) {\n try {\n const configToProvide = {\n baseUrl: strandsConfig.baseUrl,\n endpoints: strandsConfig.endpoints || {},\n supportEmail: strandsConfig.supportEmail\n }\n \n console.log('[Strands Auth Plugin] About to set global config:', configToProvide)\n \n // Set global config synchronously by setting window global\n if (typeof window !== 'undefined') {\n ;(window as any).__STRANDS_CONFIG__ = configToProvide\n console.log('[Strands Auth Plugin] ✅ Set window.__STRANDS_CONFIG__:', configToProvide)\n }\n\n // Import and set config synchronously\n import('../../vue/composables/useStrandsConfig').then(({ setStrandsConfig, provideStrandsConfig }) => {\n // Set global config\n setStrandsConfig(configToProvide)\n console.log('[Strands Auth Plugin] ✅ setStrandsConfig called successfully')\n \n // Try to provide at app level (may not work in all contexts)\n try {\n nuxtApp.vueApp.runWithContext(() => {\n provideStrandsConfig(configToProvide)\n })\n console.log('[Strands Auth Plugin] ✅ provideStrandsConfig called at app level')\n } catch (provideError) {\n console.warn('[Strands Auth Plugin] Could not provide at app level (not critical):', provideError)\n }\n }).catch(error => {\n console.error('[Strands Auth Plugin] Configuration setup error:', error)\n })\n \n // Set CSS accent color if provided\n if (strandsConfig.accentColor && typeof window !== 'undefined') {\n document.documentElement.style.setProperty('--strands-accent', strandsConfig.accentColor)\n }\n \n } catch (error) {\n console.error('[Strands Auth Plugin] Configuration error:', error)\n }\n } else {\n console.error('[Strands Auth Plugin] ❌ No baseUrl in strandsAuth config:', strandsConfig)\n }\n \n console.log('[Strands Auth Plugin] Plugin setup completed')\n }\n})\n"],"names":["plugin_client","defineNuxtPlugin","nuxtApp","config","useRuntimeConfig","strandsConfig","configToProvide","setStrandsConfig","provideStrandsConfig","provideError","error"],"mappings":";AAEA,MAAAA,IAAeC,EAAiB;AAAA,EAC9B,MAAM;AAAA,EACN,MAAMC,GAAS;AACb,YAAQ,IAAI,6CAA6C;AAGzD,UAAMC,IAASC,EAAA,GACTC,IAAgBF,EAAO,OAAO;AAUpC,QARA,QAAQ,IAAI,+CAA+C;AAAA,MACzD,kBAAkB,CAAC,CAACA;AAAA,MACpB,iBAAiB,CAAC,CAACA,EAAO;AAAA,MAC1B,gBAAgB,CAAC,CAACA,EAAO,OAAO;AAAA,MAChC,eAAAE;AAAA,MACA,kBAAkBF,EAAO;AAAA,IAAA,CAC1B,GAEGE,KAAiBA,EAAc;AACjC,UAAI;AACF,cAAMC,IAAkB;AAAA,UACtB,SAASD,EAAc;AAAA,UACvB,WAAWA,EAAc,aAAa,CAAA;AAAA,UACtC,cAAcA,EAAc;AAAA,QAAA;AAG9B,gBAAQ,IAAI,qDAAqDC,CAAe,GAG5E,OAAO,SAAW,QAClB,OAAe,qBAAqBA,GACtC,QAAQ,IAAI,0DAA0DA,CAAe,IAIvF,OAAO,oCAAwC,EAAE,KAAK,CAAC,EAAE,kBAAAC,GAAkB,sBAAAC,QAA2B;AAEpG,UAAAD,EAAiBD,CAAe,GAChC,QAAQ,IAAI,8DAA8D;AAG1E,cAAI;AACF,YAAAJ,EAAQ,OAAO,eAAe,MAAM;AAClC,cAAAM,EAAqBF,CAAe;AAAA,YACtC,CAAC,GACD,QAAQ,IAAI,kEAAkE;AAAA,UAChF,SAASG,GAAc;AACrB,oBAAQ,KAAK,wEAAwEA,CAAY;AAAA,UACnG;AAAA,QACF,CAAC,EAAE,MAAM,CAAAC,MAAS;AAChB,kBAAQ,MAAM,oDAAoDA,CAAK;AAAA,QACzE,CAAC,GAGGL,EAAc,eAAe,OAAO,SAAW,OACjD,SAAS,gBAAgB,MAAM,YAAY,oBAAoBA,EAAc,WAAW;AAAA,MAG5F,SAASK,GAAO;AACd,gBAAQ,MAAM,8CAA8CA,CAAK;AAAA,MACnE;AAAA;AAEA,cAAQ,MAAM,6DAA6DL,CAAa;AAG1F,YAAQ,IAAI,8CAA8C;AAAA,EAC5D;AACF,CAAC;"}
|
package/dist/nuxt-v4/types.d.ts
CHANGED
|
@@ -7,8 +7,8 @@ export interface StrandsUser {
|
|
|
7
7
|
avatar?: string;
|
|
8
8
|
mfaEnabled: boolean;
|
|
9
9
|
emailVerified: boolean;
|
|
10
|
-
createdAt: string;
|
|
11
|
-
updatedAt: string;
|
|
10
|
+
createdAt: string | Date;
|
|
11
|
+
updatedAt: string | Date;
|
|
12
12
|
}
|
|
13
13
|
export interface StrandsSession {
|
|
14
14
|
accessToken: string;
|
|
@@ -1 +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,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,UAAU,EAAE,OAAO,CAAA;IACnB,aAAa,EAAE,OAAO,CAAA;IACtB,SAAS,EAAE,MAAM,CAAA;
|
|
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,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,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"}
|
package/dist/nuxt-v4.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { default } from './nuxt-v4/module';
|
|
2
2
|
export type { StrandsAuthConfig } from './nuxt-v4/module';
|
|
3
3
|
export type { StrandsUser, StrandsSession } from './nuxt-v4/types';
|
|
4
|
+
export { useStrandsAuth, useAuthUser, useAuthState } from './nuxt-v4/runtime/composables/useStrandsAuth';
|
|
4
5
|
//# sourceMappingURL=nuxt-v4.d.ts.map
|
package/dist/nuxt-v4.d.ts.map
CHANGED
|
@@ -1 +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,MAAM,kBAAkB,CAAA;AACzD,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA"}
|
|
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,MAAM,kBAAkB,CAAA;AACzD,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAGlE,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,8CAA8C,CAAA"}
|