@fonderie/vue-auth 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +44 -270
- package/dist/index.d.ts +44 -270
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -344,7 +344,7 @@ function useProfile(client) {
|
|
|
344
344
|
await refresh();
|
|
345
345
|
});
|
|
346
346
|
}
|
|
347
|
-
void refresh();
|
|
347
|
+
(0, import_vue16.onMounted)(() => void refresh());
|
|
348
348
|
return { user, refresh, updateProfile, updatePreferences, updateEmail, updatePhone, isLoading, error };
|
|
349
349
|
}
|
|
350
350
|
|
|
@@ -438,7 +438,7 @@ function useSession(client) {
|
|
|
438
438
|
}
|
|
439
439
|
const token = readToken();
|
|
440
440
|
if (token) auth.setAccessToken(token);
|
|
441
|
-
void refresh();
|
|
441
|
+
(0, import_vue22.onMounted)(() => void refresh());
|
|
442
442
|
return { user, isLoading, isAuthenticated, refresh, logout };
|
|
443
443
|
}
|
|
444
444
|
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/composables/useAccountData.ts","../src/storage.ts","../src/composables/useChangePassword.ts","../src/composables/useForgotPassword.ts","../src/composables/useLogin.ts","../src/composables/useLogout.ts","../src/composables/useMfaLogin.ts","../src/composables/useMfaSetup.ts","../src/composables/useProfile.ts","../src/composables/useRegister.ts","../src/composables/useResetPassword.ts","../src/composables/useSession.ts","../src/composables/useVerifyEmail.ts"],"sourcesContent":["export type {\n\tAuthClient,\n\tIChangePasswordInput,\n\tILoginInput,\n\tILoginResult,\n\tIMfaEnabledResult,\n\tIMfaRequiredResult,\n\tIMfaSetupResult,\n\tIRegisterInput,\n\tIRegisterResult,\n\tIResetPasswordInput,\n\tITokens,\n\tIUpdatePreferencesInput,\n\tIUpdateProfileInput,\n\tIUserDTO,\n\tIVerifyEmailResult,\n} from '@fonderie/client';\n\nexport { FonderieApiError, isMfaRequired } from '@fonderie/client';\n\nexport type {\n\tIUseAccountDataReturn,\n\tIUseChangePasswordReturn,\n\tIUseMfaLoginReturn,\n\tIUseMfaSetupReturn,\n\tIUseProfileReturn,\n} from './composables';\nexport {\n\tuseAccountData,\n\tuseChangePassword,\n\tuseForgotPassword,\n\tuseLogin,\n\tuseLogout,\n\tuseMfaLogin,\n\tuseMfaSetup,\n\tuseProfile,\n\tuseRegister,\n\tuseResetPassword,\n\tuseSession,\n\tuseVerifyEmail,\n} from './composables';\n\n// Token persistence primitives — for wiring app-level flows (e.g. the\n// client's auth.onTokensChanged) to the same storage the hooks use.\nexport { clearToken, persistToken, readToken, TOKEN_KEY } from './storage';\n","import type { AuthClient } from '@fonderie/client';\nimport { FonderieApiError } from '@fonderie/client';\nimport { useFonderieSubClient } from '@fonderie/vue';\nimport type { Ref } from 'vue';\nimport { ref } from 'vue';\nimport { clearToken } from '../storage';\n\nexport interface IUseAccountDataReturn {\n\t// GET /users/export — the caller's own data as a portable bundle (SAR).\n\texportData: () => Promise<unknown>;\n\t// Deletes the account, then tears the session down like a logout.\n\tdeleteUser: () => Promise<void>;\n\tisLoading: Ref<boolean>;\n\terror: Ref<FonderieApiError | null>;\n}\n\nexport function useAccountData(client?: AuthClient): IUseAccountDataReturn {\n\tconst auth = useFonderieSubClient(client, (c) => c.auth, 'useAccountData');\n\tconst isLoading = ref(false);\n\tconst error = ref<FonderieApiError | null>(null);\n\n\tasync function run<T>(op: () => Promise<T>): Promise<T> {\n\t\tisLoading.value = true;\n\t\terror.value = null;\n\t\ttry {\n\t\t\treturn await op();\n\t\t} catch (err) {\n\t\t\tconst apiError =\n\t\t\t\terr instanceof FonderieApiError ? err : new FonderieApiError('unknown', String(err), 0);\n\t\t\terror.value = apiError;\n\t\t\tthrow apiError;\n\t\t} finally {\n\t\t\tisLoading.value = false;\n\t\t}\n\t}\n\n\tfunction exportData() {\n\t\treturn run(async () => {\n\t\t\tconst { result } = await auth.exportData();\n\t\t\treturn result;\n\t\t});\n\t}\n\n\tfunction deleteUser() {\n\t\treturn run(async () => {\n\t\t\tawait auth.deleteUser();\n\t\t\tauth.setAccessToken(undefined);\n\t\t\tclearToken();\n\t\t});\n\t}\n\n\treturn { exportData, deleteUser, isLoading, error };\n}\n","export const TOKEN_KEY = 'fonderie_access_token';\n\nexport function persistToken(token: string) {\n\tlocalStorage.setItem(TOKEN_KEY, token);\n}\n\nexport function clearToken() {\n\tlocalStorage.removeItem(TOKEN_KEY);\n}\n\nexport function readToken(): string | null {\n\treturn localStorage.getItem(TOKEN_KEY);\n}\n","import type { AuthClient, IChangePasswordInput } from '@fonderie/client';\nimport { FonderieApiError } from '@fonderie/client';\nimport { useFonderieSubClient } from '@fonderie/vue';\nimport type { Ref } from 'vue';\nimport { ref } from 'vue';\n\nexport interface IUseChangePasswordReturn {\n\tchangePassword: (input: IChangePasswordInput) => Promise<void>;\n\tisLoading: Ref<boolean>;\n\terror: Ref<FonderieApiError | null>;\n\tdone: Ref<boolean>;\n}\n\nexport function useChangePassword(client?: AuthClient): IUseChangePasswordReturn {\n\tconst auth = useFonderieSubClient(client, (c) => c.auth, 'useChangePassword');\n\tconst isLoading = ref(false);\n\tconst error = ref<FonderieApiError | null>(null);\n\tconst done = ref(false);\n\n\tasync function changePassword(input: IChangePasswordInput) {\n\t\tisLoading.value = true;\n\t\terror.value = null;\n\t\tdone.value = false;\n\t\ttry {\n\t\t\tawait auth.changePassword(input);\n\t\t\tdone.value = true;\n\t\t} catch (err) {\n\t\t\tconst apiError =\n\t\t\t\terr instanceof FonderieApiError ? err : new FonderieApiError('unknown', String(err), 0);\n\t\t\terror.value = apiError;\n\t\t\tthrow apiError;\n\t\t} finally {\n\t\t\tisLoading.value = false;\n\t\t}\n\t}\n\n\treturn { changePassword, isLoading, error, done };\n}\n","import type { AuthClient } from '@fonderie/client';\nimport { FonderieApiError } from '@fonderie/client';\nimport { useFonderieSubClient } from '@fonderie/vue';\nimport { ref } from 'vue';\n\nexport function useForgotPassword(client?: AuthClient) {\n\tconst auth = useFonderieSubClient(client, (c) => c.auth, 'useForgotPassword');\n\tconst isLoading = ref(false);\n\tconst error = ref<FonderieApiError | null>(null);\n\tconst sent = ref(false);\n\n\tasync function forgotPassword(email: string) {\n\t\tisLoading.value = true;\n\t\terror.value = null;\n\t\ttry {\n\t\t\tawait auth.forgotPassword(email);\n\t\t\tsent.value = true;\n\t\t} catch (err) {\n\t\t\tconst apiError =\n\t\t\t\terr instanceof FonderieApiError ? err : new FonderieApiError('unknown', String(err), 0);\n\t\t\terror.value = apiError;\n\t\t\tthrow apiError;\n\t\t} finally {\n\t\t\tisLoading.value = false;\n\t\t}\n\t}\n\n\treturn { forgotPassword, isLoading, error, sent };\n}\n","import type { AuthClient, ILoginInput, ILoginResult, IMfaRequiredResult } from '@fonderie/client';\nimport { FonderieApiError, isMfaRequired } from '@fonderie/client';\nimport { useFonderieSubClient } from '@fonderie/vue';\nimport { ref } from 'vue';\nimport { persistToken } from '../storage';\n\nexport function useLogin(client?: AuthClient) {\n\tconst auth = useFonderieSubClient(client, (c) => c.auth, 'useLogin');\n\tconst isLoading = ref(false);\n\tconst error = ref<FonderieApiError | null>(null);\n\tconst data = ref<ILoginResult | null>(null);\n\t// Set when the account requires MFA: complete the login with\n\t// client.auth.mfa.verifyLogin(mfaPending.value.mfaToken, code).\n\tconst mfaPending = ref<IMfaRequiredResult | null>(null);\n\n\tasync function login(input: ILoginInput) {\n\t\tisLoading.value = true;\n\t\terror.value = null;\n\t\tmfaPending.value = null;\n\t\ttry {\n\t\t\tconst { result } = await auth.login(input);\n\t\t\tif (isMfaRequired(result)) {\n\t\t\t\tmfaPending.value = result;\n\t\t\t\treturn result;\n\t\t\t}\n\t\t\tauth.setAccessToken(result.tokens.access);\n\t\t\tpersistToken(result.tokens.access);\n\t\t\tdata.value = result;\n\t\t\treturn result;\n\t\t} catch (err) {\n\t\t\tconst apiError =\n\t\t\t\terr instanceof FonderieApiError ? err : new FonderieApiError('unknown', String(err), 0);\n\t\t\terror.value = apiError;\n\t\t\tthrow apiError;\n\t\t} finally {\n\t\t\tisLoading.value = false;\n\t\t}\n\t}\n\n\treturn { login, isLoading, error, data, mfaPending };\n}\n","import type { AuthClient } from '@fonderie/client';\nimport { FonderieApiError } from '@fonderie/client';\nimport { useFonderieSubClient } from '@fonderie/vue';\nimport { ref } from 'vue';\nimport { clearToken } from '../storage';\n\nexport function useLogout(client?: AuthClient) {\n\tconst auth = useFonderieSubClient(client, (c) => c.auth, 'useLogout');\n\tconst isLoading = ref(false);\n\tconst error = ref<FonderieApiError | null>(null);\n\n\tasync function logout(refreshToken?: string) {\n\t\tisLoading.value = true;\n\t\terror.value = null;\n\t\ttry {\n\t\t\tawait auth.logout(refreshToken);\n\t\t} catch (err) {\n\t\t\tconst apiError =\n\t\t\t\terr instanceof FonderieApiError ? err : new FonderieApiError('unknown', String(err), 0);\n\t\t\terror.value = apiError;\n\t\t} finally {\n\t\t\tauth.setAccessToken(undefined);\n\t\t\tclearToken();\n\t\t\tisLoading.value = false;\n\t\t}\n\t}\n\n\treturn { logout, isLoading, error };\n}\n","import type { AuthClient, ILoginResult } from '@fonderie/client';\nimport { FonderieApiError } from '@fonderie/client';\nimport { useFonderieSubClient } from '@fonderie/vue';\nimport type { Ref } from 'vue';\nimport { ref } from 'vue';\nimport { persistToken } from '../storage';\n\nexport interface IUseMfaLoginReturn {\n\t// Completes a login that returned MFA_REQUIRED: verifies the TOTP code\n\t// against the temporary mfaToken from useLogin's mfaPending, then persists\n\t// the issued tokens exactly like a normal login.\n\tverifyLogin: (mfaToken: string, code: string) => Promise<ILoginResult>;\n\tisLoading: Ref<boolean>;\n\terror: Ref<FonderieApiError | null>;\n\tdata: Ref<ILoginResult | null>;\n}\n\nexport function useMfaLogin(client?: AuthClient): IUseMfaLoginReturn {\n\tconst auth = useFonderieSubClient(client, (c) => c.auth, 'useMfaLogin');\n\tconst isLoading = ref(false);\n\tconst error = ref<FonderieApiError | null>(null);\n\tconst data = ref<ILoginResult | null>(null);\n\n\tasync function verifyLogin(mfaToken: string, code: string) {\n\t\tisLoading.value = true;\n\t\terror.value = null;\n\t\ttry {\n\t\t\tconst { result } = await auth.mfa.verifyLogin(mfaToken, code);\n\t\t\tauth.setAccessToken(result.tokens.access);\n\t\t\tpersistToken(result.tokens.access);\n\t\t\tdata.value = result;\n\t\t\treturn result;\n\t\t} catch (err) {\n\t\t\tconst apiError =\n\t\t\t\terr instanceof FonderieApiError ? err : new FonderieApiError('unknown', String(err), 0);\n\t\t\terror.value = apiError;\n\t\t\tthrow apiError;\n\t\t} finally {\n\t\t\tisLoading.value = false;\n\t\t}\n\t}\n\n\treturn { verifyLogin, isLoading, error, data };\n}\n","import type { AuthClient, IMfaEnabledResult, IMfaSetupResult } from '@fonderie/client';\nimport { FonderieApiError } from '@fonderie/client';\nimport { useFonderieSubClient } from '@fonderie/vue';\nimport type { Ref } from 'vue';\nimport { ref } from 'vue';\nimport { persistToken } from '../storage';\n\nexport interface IUseMfaSetupReturn {\n\t// Step 1: request enrollment — returns a data-URI QR code to scan and the\n\t// one-time backup codes generated at setup.\n\tsetup: () => Promise<IMfaSetupResult>;\n\tsetupData: Ref<IMfaSetupResult | null>;\n\t// Step 2: verify the first TOTP code. The server rotates the session's\n\t// tokens on success — the composable persists them exactly like a login,\n\t// so the session stays valid after enrollment.\n\tverify: (code: string) => Promise<IMfaEnabledResult>;\n\tdisable: (code: string) => Promise<void>;\n\tregenerateBackupCodes: (code: string) => Promise<string[]>;\n\tisLoading: Ref<boolean>;\n\terror: Ref<FonderieApiError | null>;\n}\n\nexport function useMfaSetup(client?: AuthClient): IUseMfaSetupReturn {\n\tconst auth = useFonderieSubClient(client, (c) => c.auth, 'useMfaSetup');\n\tconst setupData = ref<IMfaSetupResult | null>(null);\n\tconst isLoading = ref(false);\n\tconst error = ref<FonderieApiError | null>(null);\n\n\tasync function run<T>(op: () => Promise<T>): Promise<T> {\n\t\tisLoading.value = true;\n\t\terror.value = null;\n\t\ttry {\n\t\t\treturn await op();\n\t\t} catch (err) {\n\t\t\tconst apiError =\n\t\t\t\terr instanceof FonderieApiError ? err : new FonderieApiError('unknown', String(err), 0);\n\t\t\terror.value = apiError;\n\t\t\tthrow apiError;\n\t\t} finally {\n\t\t\tisLoading.value = false;\n\t\t}\n\t}\n\n\tfunction setup() {\n\t\treturn run(async () => {\n\t\t\tconst { result } = await auth.mfa.setup();\n\t\t\tsetupData.value = result;\n\t\t\treturn result;\n\t\t});\n\t}\n\n\tfunction verify(code: string) {\n\t\treturn run(async () => {\n\t\t\tconst { result } = await auth.mfa.verify(code);\n\t\t\tauth.setAccessToken(result.tokens.access);\n\t\t\tpersistToken(result.tokens.access);\n\t\t\treturn result;\n\t\t});\n\t}\n\n\tfunction disable(code: string) {\n\t\treturn run(async () => {\n\t\t\tawait auth.mfa.disable(code);\n\t\t});\n\t}\n\n\tfunction regenerateBackupCodes(code: string) {\n\t\treturn run(async () => {\n\t\t\tconst { result } = await auth.mfa.regenerateBackupCodes(code);\n\t\t\treturn result.backupCodes;\n\t\t});\n\t}\n\n\treturn { setup, setupData, verify, disable, regenerateBackupCodes, isLoading, error };\n}\n","import type {\n\tAuthClient,\n\tIUpdatePreferencesInput,\n\tIUpdateProfileInput,\n\tIUserDTO,\n} from '@fonderie/client';\nimport { FonderieApiError } from '@fonderie/client';\nimport { useFonderieSubClient } from '@fonderie/vue';\nimport type { Ref } from 'vue';\nimport { ref } from 'vue';\n\nexport interface IUseProfileReturn {\n\tuser: Ref<IUserDTO | null>;\n\trefresh: (opts?: { force?: boolean }) => Promise<void>;\n\tupdateProfile: (input: IUpdateProfileInput) => Promise<IUserDTO>;\n\tupdatePreferences: (input: IUpdatePreferencesInput) => Promise<IUserDTO>;\n\t// Email/phone changes re-fetch the profile (their endpoints don't return it).\n\tupdateEmail: (email: string) => Promise<void>;\n\tupdatePhone: (phone: string) => Promise<void>;\n\tisLoading: Ref<boolean>;\n\terror: Ref<FonderieApiError | null>;\n}\n\nexport function useProfile(client?: AuthClient): IUseProfileReturn {\n\tconst auth = useFonderieSubClient(client, (c) => c.auth, 'useProfile');\n\tconst user = ref<IUserDTO | null>(null);\n\tconst isLoading = ref(true);\n\tconst error = ref<FonderieApiError | null>(null);\n\n\tasync function refresh(opts?: { force?: boolean }) {\n\t\tisLoading.value = true;\n\t\terror.value = null;\n\t\ttry {\n\t\t\tconst { result } = await auth.getUser({ bust: opts?.force });\n\t\t\tuser.value = result.user;\n\t\t} catch (err) {\n\t\t\tconst apiError =\n\t\t\t\terr instanceof FonderieApiError ? err : new FonderieApiError('unknown', String(err), 0);\n\t\t\terror.value = apiError;\n\t\t} finally {\n\t\t\tisLoading.value = false;\n\t\t}\n\t}\n\n\tasync function mutate<T>(op: () => Promise<T>): Promise<T> {\n\t\terror.value = null;\n\t\ttry {\n\t\t\treturn await op();\n\t\t} catch (err) {\n\t\t\tconst apiError =\n\t\t\t\terr instanceof FonderieApiError ? err : new FonderieApiError('unknown', String(err), 0);\n\t\t\terror.value = apiError;\n\t\t\tthrow apiError;\n\t\t}\n\t}\n\n\tfunction updateProfile(input: IUpdateProfileInput) {\n\t\treturn mutate(async () => {\n\t\t\tconst { result } = await auth.updateProfile(input);\n\t\t\tuser.value = result.user;\n\t\t\treturn result.user;\n\t\t});\n\t}\n\n\tfunction updatePreferences(input: IUpdatePreferencesInput) {\n\t\treturn mutate(async () => {\n\t\t\tconst { result } = await auth.updatePreferences(input);\n\t\t\tuser.value = result.user;\n\t\t\treturn result.user;\n\t\t});\n\t}\n\n\tfunction updateEmail(email: string) {\n\t\treturn mutate(async () => {\n\t\t\tawait auth.updateEmail(email);\n\t\t\tawait refresh();\n\t\t});\n\t}\n\n\tfunction updatePhone(phone: string) {\n\t\treturn mutate(async () => {\n\t\t\tawait auth.updatePhone(phone);\n\t\t\tawait refresh();\n\t\t});\n\t}\n\n\tvoid refresh();\n\n\treturn { user, refresh, updateProfile, updatePreferences, updateEmail, updatePhone, isLoading, error };\n}\n","import type { AuthClient, IRegisterInput, IRegisterResult } from '@fonderie/client';\nimport { FonderieApiError } from '@fonderie/client';\nimport { useFonderieSubClient } from '@fonderie/vue';\nimport { ref } from 'vue';\nimport { persistToken } from '../storage';\n\nexport function useRegister(client?: AuthClient) {\n\tconst auth = useFonderieSubClient(client, (c) => c.auth, 'useRegister');\n\tconst isLoading = ref(false);\n\tconst error = ref<FonderieApiError | null>(null);\n\tconst data = ref<IRegisterResult | null>(null);\n\n\tasync function register(input: IRegisterInput) {\n\t\tisLoading.value = true;\n\t\terror.value = null;\n\t\ttry {\n\t\t\tconst { result } = await auth.register(input);\n\t\t\tauth.setAccessToken(result.tokens.access);\n\t\t\tpersistToken(result.tokens.access);\n\t\t\tdata.value = result;\n\t\t\treturn result;\n\t\t} catch (err) {\n\t\t\tconst apiError =\n\t\t\t\terr instanceof FonderieApiError ? err : new FonderieApiError('unknown', String(err), 0);\n\t\t\terror.value = apiError;\n\t\t\tthrow apiError;\n\t\t} finally {\n\t\t\tisLoading.value = false;\n\t\t}\n\t}\n\n\treturn { register, isLoading, error, data };\n}\n","import type { AuthClient, IResetPasswordInput } from '@fonderie/client';\nimport { FonderieApiError } from '@fonderie/client';\nimport { useFonderieSubClient } from '@fonderie/vue';\nimport { ref } from 'vue';\n\nexport function useResetPassword(client?: AuthClient) {\n\tconst auth = useFonderieSubClient(client, (c) => c.auth, 'useResetPassword');\n\tconst isLoading = ref(false);\n\tconst error = ref<FonderieApiError | null>(null);\n\tconst done = ref(false);\n\n\tasync function resetPassword(input: IResetPasswordInput) {\n\t\tisLoading.value = true;\n\t\terror.value = null;\n\t\ttry {\n\t\t\tawait auth.resetPassword(input);\n\t\t\tdone.value = true;\n\t\t} catch (err) {\n\t\t\tconst apiError =\n\t\t\t\terr instanceof FonderieApiError ? err : new FonderieApiError('unknown', String(err), 0);\n\t\t\terror.value = apiError;\n\t\t\tthrow apiError;\n\t\t} finally {\n\t\t\tisLoading.value = false;\n\t\t}\n\t}\n\n\treturn { resetPassword, isLoading, error, done };\n}\n","import type { AuthClient, IUserDTO } from '@fonderie/client';\nimport { useFonderieSubClient } from '@fonderie/vue';\nimport { ref } from 'vue';\nimport { clearToken, readToken } from '../storage';\n\nexport function useSession(client?: AuthClient) {\n\tconst auth = useFonderieSubClient(client, (c) => c.auth, 'useSession');\n\tconst user = ref<IUserDTO | null>(null);\n\tconst isLoading = ref(true);\n\tconst isAuthenticated = ref(false);\n\n\tasync function refresh(opts?: { force?: boolean }) {\n\t\tisLoading.value = true;\n\t\ttry {\n\t\t\tconst { result } = await auth.getUser({ bust: opts?.force });\n\t\t\tuser.value = result.user;\n\t\t\tisAuthenticated.value = true;\n\t\t} catch {\n\t\t\tuser.value = null;\n\t\t\tisAuthenticated.value = false;\n\t\t\tauth.setAccessToken(undefined);\n\t\t\tclearToken();\n\t\t} finally {\n\t\t\tisLoading.value = false;\n\t\t}\n\t}\n\n\tasync function logout(refreshToken?: string) {\n\t\ttry {\n\t\t\tawait auth.logout(refreshToken);\n\t\t} catch {\n\t\t\t// Session is being torn down regardless of server response.\n\t\t}\n\t\tauth.setAccessToken(undefined);\n\t\tclearToken();\n\t\tuser.value = null;\n\t\tisAuthenticated.value = false;\n\t}\n\n\tconst token = readToken();\n\tif (token) auth.setAccessToken(token);\n\tvoid refresh();\n\n\treturn { user, isLoading, isAuthenticated, refresh, logout };\n}\n","import type { AuthClient, IVerifyEmailResult } from '@fonderie/client';\nimport { FonderieApiError } from '@fonderie/client';\nimport { useFonderieSubClient } from '@fonderie/vue';\nimport { ref } from 'vue';\n\nexport function useVerifyEmail(client?: AuthClient) {\n\tconst auth = useFonderieSubClient(client, (c) => c.auth, 'useVerifyEmail');\n\tconst isLoading = ref(false);\n\tconst error = ref<FonderieApiError | null>(null);\n\tconst data = ref<IVerifyEmailResult | null>(null);\n\tconst resent = ref(false);\n\n\t// Re-sends the verification email — the other half of the same lifecycle,\n\t// so one composable owns both and screens don't split loading/error handling.\n\tasync function resend() {\n\t\tisLoading.value = true;\n\t\terror.value = null;\n\t\tresent.value = false;\n\t\ttry {\n\t\t\tawait auth.sendVerificationEmail();\n\t\t\tresent.value = true;\n\t\t} catch (err) {\n\t\t\tconst apiError =\n\t\t\t\terr instanceof FonderieApiError ? err : new FonderieApiError('unknown', String(err), 0);\n\t\t\terror.value = apiError;\n\t\t\tthrow apiError;\n\t\t} finally {\n\t\t\tisLoading.value = false;\n\t\t}\n\t}\n\n\tasync function verifyEmail(pin: string) {\n\t\tisLoading.value = true;\n\t\terror.value = null;\n\t\ttry {\n\t\t\tconst { result } = await auth.verifyEmail(pin);\n\t\t\tdata.value = result;\n\t\t\treturn result;\n\t\t} catch (err) {\n\t\t\tconst apiError =\n\t\t\t\terr instanceof FonderieApiError ? err : new FonderieApiError('unknown', String(err), 0);\n\t\t\terror.value = apiError;\n\t\t\tthrow apiError;\n\t\t} finally {\n\t\t\tisLoading.value = false;\n\t\t}\n\t}\n\n\treturn { verifyEmail, resend, resent, isLoading, error, data };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAkBA,IAAAA,kBAAgD;;;ACjBhD,oBAAiC;AACjC,iBAAqC;AAErC,IAAAC,cAAoB;;;ACJb,IAAM,YAAY;AAElB,SAAS,aAAa,OAAe;AAC3C,eAAa,QAAQ,WAAW,KAAK;AACtC;AAEO,SAAS,aAAa;AAC5B,eAAa,WAAW,SAAS;AAClC;AAEO,SAAS,YAA2B;AAC1C,SAAO,aAAa,QAAQ,SAAS;AACtC;;;ADIO,SAAS,eAAe,QAA4C;AAC1E,QAAM,WAAO,iCAAqB,QAAQ,CAAC,MAAM,EAAE,MAAM,gBAAgB;AACzE,QAAM,gBAAY,iBA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,KAAa;AACvC,cAAU,QAAQ;AAClB,UAAM,QAAQ;AACd,QAAI;AACH,YAAM,EAAE,OAAO,IAAI,MAAM,KAAK,YAAY,GAAG;AAC7C,WAAK,QAAQ;AACb,aAAO;AAAA,IACR,SAAS,KAAK;AACb,YAAM,WACL,eAAe,mCAAmB,MAAM,IAAI,iCAAiB,WAAW,OAAO,GAAG,GAAG,CAAC;AACvF,YAAM,QAAQ;AACd,YAAM;AAAA,IACP,UAAE;AACD,gBAAU,QAAQ;AAAA,IACnB;AAAA,EACD;AAEA,SAAO,EAAE,aAAa,QAAQ,QAAQ,WAAW,OAAO,KAAK;AAC9D;","names":["import_client","import_vue","import_client","import_vue","import_client","import_vue","import_client","import_vue","import_client","import_vue","import_client","import_vue","import_client","import_vue","import_client","import_vue","import_client","import_vue","import_client","import_vue","import_vue","import_client","import_vue"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/composables/useAccountData.ts","../src/storage.ts","../src/composables/useChangePassword.ts","../src/composables/useForgotPassword.ts","../src/composables/useLogin.ts","../src/composables/useLogout.ts","../src/composables/useMfaLogin.ts","../src/composables/useMfaSetup.ts","../src/composables/useProfile.ts","../src/composables/useRegister.ts","../src/composables/useResetPassword.ts","../src/composables/useSession.ts","../src/composables/useVerifyEmail.ts"],"sourcesContent":["export type {\n\tAuthClient,\n\tIChangePasswordInput,\n\tILoginInput,\n\tILoginResult,\n\tIMfaEnabledResult,\n\tIMfaRequiredResult,\n\tIMfaSetupResult,\n\tIRegisterInput,\n\tIRegisterResult,\n\tIResetPasswordInput,\n\tITokens,\n\tIUpdatePreferencesInput,\n\tIUpdateProfileInput,\n\tIUserDTO,\n\tIVerifyEmailResult,\n} from '@fonderie/client';\n\nexport { FonderieApiError, isMfaRequired } from '@fonderie/client';\n\nexport type {\n\tIUseAccountDataReturn,\n\tIUseChangePasswordReturn,\n\tIUseForgotPasswordReturn,\n\tIUseLoginReturn,\n\tIUseLogoutReturn,\n\tIUseMfaLoginReturn,\n\tIUseMfaSetupReturn,\n\tIUseProfileReturn,\n\tIUseRegisterReturn,\n\tIUseResetPasswordReturn,\n\tIUseSessionReturn,\n\tIUseVerifyEmailReturn,\n} from './composables';\nexport {\n\tuseAccountData,\n\tuseChangePassword,\n\tuseForgotPassword,\n\tuseLogin,\n\tuseLogout,\n\tuseMfaLogin,\n\tuseMfaSetup,\n\tuseProfile,\n\tuseRegister,\n\tuseResetPassword,\n\tuseSession,\n\tuseVerifyEmail,\n} from './composables';\n\n// Token persistence primitives — for wiring app-level flows (e.g. the\n// client's auth.onTokensChanged) to the same storage the hooks use.\nexport { clearToken, persistToken, readToken, TOKEN_KEY } from './storage';\n","import type { AuthClient } from '@fonderie/client';\nimport { FonderieApiError } from '@fonderie/client';\nimport { useFonderieSubClient } from '@fonderie/vue';\nimport type { Ref } from 'vue';\nimport { ref } from 'vue';\nimport { clearToken } from '../storage';\n\nexport interface IUseAccountDataReturn {\n\t// GET /users/export — the caller's own data as a portable bundle (SAR).\n\texportData: () => Promise<unknown>;\n\t// Deletes the account, then tears the session down like a logout.\n\tdeleteUser: () => Promise<void>;\n\tisLoading: Ref<boolean>;\n\terror: Ref<FonderieApiError | null>;\n}\n\nexport function useAccountData(client?: AuthClient): IUseAccountDataReturn {\n\tconst auth = useFonderieSubClient(client, (c) => c.auth, 'useAccountData');\n\tconst isLoading = ref(false);\n\tconst error = ref<FonderieApiError | null>(null);\n\n\tasync function run<T>(op: () => Promise<T>): Promise<T> {\n\t\tisLoading.value = true;\n\t\terror.value = null;\n\t\ttry {\n\t\t\treturn await op();\n\t\t} catch (err) {\n\t\t\tconst apiError =\n\t\t\t\terr instanceof FonderieApiError ? err : new FonderieApiError('unknown', String(err), 0);\n\t\t\terror.value = apiError;\n\t\t\tthrow apiError;\n\t\t} finally {\n\t\t\tisLoading.value = false;\n\t\t}\n\t}\n\n\tfunction exportData() {\n\t\treturn run(async () => {\n\t\t\tconst { result } = await auth.exportData();\n\t\t\treturn result;\n\t\t});\n\t}\n\n\tfunction deleteUser() {\n\t\treturn run(async () => {\n\t\t\tawait auth.deleteUser();\n\t\t\tauth.setAccessToken(undefined);\n\t\t\tclearToken();\n\t\t});\n\t}\n\n\treturn { exportData, deleteUser, isLoading, error };\n}\n","export const TOKEN_KEY = 'fonderie_access_token';\n\nexport function persistToken(token: string) {\n\tlocalStorage.setItem(TOKEN_KEY, token);\n}\n\nexport function clearToken() {\n\tlocalStorage.removeItem(TOKEN_KEY);\n}\n\nexport function readToken(): string | null {\n\treturn localStorage.getItem(TOKEN_KEY);\n}\n","import type { AuthClient, IChangePasswordInput } from '@fonderie/client';\nimport { FonderieApiError } from '@fonderie/client';\nimport { useFonderieSubClient } from '@fonderie/vue';\nimport type { Ref } from 'vue';\nimport { ref } from 'vue';\n\nexport interface IUseChangePasswordReturn {\n\tchangePassword: (input: IChangePasswordInput) => Promise<void>;\n\tisLoading: Ref<boolean>;\n\terror: Ref<FonderieApiError | null>;\n\tdone: Ref<boolean>;\n}\n\nexport function useChangePassword(client?: AuthClient): IUseChangePasswordReturn {\n\tconst auth = useFonderieSubClient(client, (c) => c.auth, 'useChangePassword');\n\tconst isLoading = ref(false);\n\tconst error = ref<FonderieApiError | null>(null);\n\tconst done = ref(false);\n\n\tasync function changePassword(input: IChangePasswordInput) {\n\t\tisLoading.value = true;\n\t\terror.value = null;\n\t\tdone.value = false;\n\t\ttry {\n\t\t\tawait auth.changePassword(input);\n\t\t\tdone.value = true;\n\t\t} catch (err) {\n\t\t\tconst apiError =\n\t\t\t\terr instanceof FonderieApiError ? err : new FonderieApiError('unknown', String(err), 0);\n\t\t\terror.value = apiError;\n\t\t\tthrow apiError;\n\t\t} finally {\n\t\t\tisLoading.value = false;\n\t\t}\n\t}\n\n\treturn { changePassword, isLoading, error, done };\n}\n","import type { AuthClient } from '@fonderie/client';\nimport { FonderieApiError } from '@fonderie/client';\nimport { useFonderieSubClient } from '@fonderie/vue';\nimport type { Ref } from 'vue';\nimport { ref } from 'vue';\n\nexport interface IUseForgotPasswordReturn {\n\tforgotPassword: (email: string) => Promise<void>;\n\tisLoading: Ref<boolean>;\n\terror: Ref<FonderieApiError | null>;\n\tsent: Ref<boolean>;\n}\n\nexport function useForgotPassword(client?: AuthClient): IUseForgotPasswordReturn {\n\tconst auth = useFonderieSubClient(client, (c) => c.auth, 'useForgotPassword');\n\tconst isLoading = ref(false);\n\tconst error = ref<FonderieApiError | null>(null);\n\tconst sent = ref(false);\n\n\tasync function forgotPassword(email: string) {\n\t\tisLoading.value = true;\n\t\terror.value = null;\n\t\ttry {\n\t\t\tawait auth.forgotPassword(email);\n\t\t\tsent.value = true;\n\t\t} catch (err) {\n\t\t\tconst apiError =\n\t\t\t\terr instanceof FonderieApiError ? err : new FonderieApiError('unknown', String(err), 0);\n\t\t\terror.value = apiError;\n\t\t\tthrow apiError;\n\t\t} finally {\n\t\t\tisLoading.value = false;\n\t\t}\n\t}\n\n\treturn { forgotPassword, isLoading, error, sent };\n}\n","import type { AuthClient, ILoginInput, ILoginResult, IMfaRequiredResult } from '@fonderie/client';\nimport { FonderieApiError, isMfaRequired } from '@fonderie/client';\nimport { useFonderieSubClient } from '@fonderie/vue';\nimport type { Ref } from 'vue';\nimport { ref } from 'vue';\nimport { persistToken } from '../storage';\n\nexport interface IUseLoginReturn {\n\tlogin: (input: ILoginInput) => Promise<ILoginResult | IMfaRequiredResult>;\n\tisLoading: Ref<boolean>;\n\terror: Ref<FonderieApiError | null>;\n\tdata: Ref<ILoginResult | null>;\n\t// Set when the account requires MFA: no tokens were issued — complete the\n\t// login with client.auth.mfa.verifyLogin(mfaPending.value.mfaToken, code).\n\tmfaPending: Ref<IMfaRequiredResult | null>;\n}\n\nexport function useLogin(client?: AuthClient): IUseLoginReturn {\n\tconst auth = useFonderieSubClient(client, (c) => c.auth, 'useLogin');\n\tconst isLoading = ref(false);\n\tconst error = ref<FonderieApiError | null>(null);\n\tconst data = ref<ILoginResult | null>(null);\n\t// Set when the account requires MFA: complete the login with\n\t// client.auth.mfa.verifyLogin(mfaPending.value.mfaToken, code).\n\tconst mfaPending = ref<IMfaRequiredResult | null>(null);\n\n\tasync function login(input: ILoginInput) {\n\t\tisLoading.value = true;\n\t\terror.value = null;\n\t\tmfaPending.value = null;\n\t\ttry {\n\t\t\tconst { result } = await auth.login(input);\n\t\t\tif (isMfaRequired(result)) {\n\t\t\t\tmfaPending.value = result;\n\t\t\t\treturn result;\n\t\t\t}\n\t\t\tauth.setAccessToken(result.tokens.access);\n\t\t\tpersistToken(result.tokens.access);\n\t\t\tdata.value = result;\n\t\t\treturn result;\n\t\t} catch (err) {\n\t\t\tconst apiError =\n\t\t\t\terr instanceof FonderieApiError ? err : new FonderieApiError('unknown', String(err), 0);\n\t\t\terror.value = apiError;\n\t\t\tthrow apiError;\n\t\t} finally {\n\t\t\tisLoading.value = false;\n\t\t}\n\t}\n\n\treturn { login, isLoading, error, data, mfaPending };\n}\n","import type { AuthClient } from '@fonderie/client';\nimport { FonderieApiError } from '@fonderie/client';\nimport { useFonderieSubClient } from '@fonderie/vue';\nimport type { Ref } from 'vue';\nimport { ref } from 'vue';\nimport { clearToken } from '../storage';\n\nexport interface IUseLogoutReturn {\n\tlogout: (refreshToken?: string) => Promise<void>;\n\tisLoading: Ref<boolean>;\n\terror: Ref<FonderieApiError | null>;\n}\n\nexport function useLogout(client?: AuthClient): IUseLogoutReturn {\n\tconst auth = useFonderieSubClient(client, (c) => c.auth, 'useLogout');\n\tconst isLoading = ref(false);\n\tconst error = ref<FonderieApiError | null>(null);\n\n\tasync function logout(refreshToken?: string) {\n\t\tisLoading.value = true;\n\t\terror.value = null;\n\t\ttry {\n\t\t\tawait auth.logout(refreshToken);\n\t\t} catch (err) {\n\t\t\tconst apiError =\n\t\t\t\terr instanceof FonderieApiError ? err : new FonderieApiError('unknown', String(err), 0);\n\t\t\terror.value = apiError;\n\t\t} finally {\n\t\t\tauth.setAccessToken(undefined);\n\t\t\tclearToken();\n\t\t\tisLoading.value = false;\n\t\t}\n\t}\n\n\treturn { logout, isLoading, error };\n}\n","import type { AuthClient, ILoginResult } from '@fonderie/client';\nimport { FonderieApiError } from '@fonderie/client';\nimport { useFonderieSubClient } from '@fonderie/vue';\nimport type { Ref } from 'vue';\nimport { ref } from 'vue';\nimport { persistToken } from '../storage';\n\nexport interface IUseMfaLoginReturn {\n\t// Completes a login that returned MFA_REQUIRED: verifies the TOTP code\n\t// against the temporary mfaToken from useLogin's mfaPending, then persists\n\t// the issued tokens exactly like a normal login.\n\tverifyLogin: (mfaToken: string, code: string) => Promise<ILoginResult>;\n\tisLoading: Ref<boolean>;\n\terror: Ref<FonderieApiError | null>;\n\tdata: Ref<ILoginResult | null>;\n}\n\nexport function useMfaLogin(client?: AuthClient): IUseMfaLoginReturn {\n\tconst auth = useFonderieSubClient(client, (c) => c.auth, 'useMfaLogin');\n\tconst isLoading = ref(false);\n\tconst error = ref<FonderieApiError | null>(null);\n\tconst data = ref<ILoginResult | null>(null);\n\n\tasync function verifyLogin(mfaToken: string, code: string) {\n\t\tisLoading.value = true;\n\t\terror.value = null;\n\t\ttry {\n\t\t\tconst { result } = await auth.mfa.verifyLogin(mfaToken, code);\n\t\t\tauth.setAccessToken(result.tokens.access);\n\t\t\tpersistToken(result.tokens.access);\n\t\t\tdata.value = result;\n\t\t\treturn result;\n\t\t} catch (err) {\n\t\t\tconst apiError =\n\t\t\t\terr instanceof FonderieApiError ? err : new FonderieApiError('unknown', String(err), 0);\n\t\t\terror.value = apiError;\n\t\t\tthrow apiError;\n\t\t} finally {\n\t\t\tisLoading.value = false;\n\t\t}\n\t}\n\n\treturn { verifyLogin, isLoading, error, data };\n}\n","import type { AuthClient, IMfaEnabledResult, IMfaSetupResult } from '@fonderie/client';\nimport { FonderieApiError } from '@fonderie/client';\nimport { useFonderieSubClient } from '@fonderie/vue';\nimport type { Ref } from 'vue';\nimport { ref } from 'vue';\nimport { persistToken } from '../storage';\n\nexport interface IUseMfaSetupReturn {\n\t// Step 1: request enrollment — returns a data-URI QR code to scan and the\n\t// one-time backup codes generated at setup.\n\tsetup: () => Promise<IMfaSetupResult>;\n\tsetupData: Ref<IMfaSetupResult | null>;\n\t// Step 2: verify the first TOTP code. The server rotates the session's\n\t// tokens on success — the composable persists them exactly like a login,\n\t// so the session stays valid after enrollment.\n\tverify: (code: string) => Promise<IMfaEnabledResult>;\n\tdisable: (code: string) => Promise<void>;\n\tregenerateBackupCodes: (code: string) => Promise<string[]>;\n\tisLoading: Ref<boolean>;\n\terror: Ref<FonderieApiError | null>;\n}\n\nexport function useMfaSetup(client?: AuthClient): IUseMfaSetupReturn {\n\tconst auth = useFonderieSubClient(client, (c) => c.auth, 'useMfaSetup');\n\tconst setupData = ref<IMfaSetupResult | null>(null);\n\tconst isLoading = ref(false);\n\tconst error = ref<FonderieApiError | null>(null);\n\n\tasync function run<T>(op: () => Promise<T>): Promise<T> {\n\t\tisLoading.value = true;\n\t\terror.value = null;\n\t\ttry {\n\t\t\treturn await op();\n\t\t} catch (err) {\n\t\t\tconst apiError =\n\t\t\t\terr instanceof FonderieApiError ? err : new FonderieApiError('unknown', String(err), 0);\n\t\t\terror.value = apiError;\n\t\t\tthrow apiError;\n\t\t} finally {\n\t\t\tisLoading.value = false;\n\t\t}\n\t}\n\n\tfunction setup() {\n\t\treturn run(async () => {\n\t\t\tconst { result } = await auth.mfa.setup();\n\t\t\tsetupData.value = result;\n\t\t\treturn result;\n\t\t});\n\t}\n\n\tfunction verify(code: string) {\n\t\treturn run(async () => {\n\t\t\tconst { result } = await auth.mfa.verify(code);\n\t\t\tauth.setAccessToken(result.tokens.access);\n\t\t\tpersistToken(result.tokens.access);\n\t\t\treturn result;\n\t\t});\n\t}\n\n\tfunction disable(code: string) {\n\t\treturn run(async () => {\n\t\t\tawait auth.mfa.disable(code);\n\t\t});\n\t}\n\n\tfunction regenerateBackupCodes(code: string) {\n\t\treturn run(async () => {\n\t\t\tconst { result } = await auth.mfa.regenerateBackupCodes(code);\n\t\t\treturn result.backupCodes;\n\t\t});\n\t}\n\n\treturn { setup, setupData, verify, disable, regenerateBackupCodes, isLoading, error };\n}\n","import type {\n\tAuthClient,\n\tIUpdatePreferencesInput,\n\tIUpdateProfileInput,\n\tIUserDTO,\n} from '@fonderie/client';\nimport { FonderieApiError } from '@fonderie/client';\nimport { useFonderieSubClient } from '@fonderie/vue';\nimport type { Ref } from 'vue';\nimport { onMounted, ref } from 'vue';\n\nexport interface IUseProfileReturn {\n\tuser: Ref<IUserDTO | null>;\n\trefresh: (opts?: { force?: boolean }) => Promise<void>;\n\tupdateProfile: (input: IUpdateProfileInput) => Promise<IUserDTO>;\n\tupdatePreferences: (input: IUpdatePreferencesInput) => Promise<IUserDTO>;\n\t// Email/phone changes re-fetch the profile (their endpoints don't return it).\n\tupdateEmail: (email: string) => Promise<void>;\n\tupdatePhone: (phone: string) => Promise<void>;\n\tisLoading: Ref<boolean>;\n\terror: Ref<FonderieApiError | null>;\n}\n\nexport function useProfile(client?: AuthClient): IUseProfileReturn {\n\tconst auth = useFonderieSubClient(client, (c) => c.auth, 'useProfile');\n\tconst user = ref<IUserDTO | null>(null);\n\tconst isLoading = ref(true);\n\tconst error = ref<FonderieApiError | null>(null);\n\n\tasync function refresh(opts?: { force?: boolean }) {\n\t\tisLoading.value = true;\n\t\terror.value = null;\n\t\ttry {\n\t\t\tconst { result } = await auth.getUser({ bust: opts?.force });\n\t\t\tuser.value = result.user;\n\t\t} catch (err) {\n\t\t\tconst apiError =\n\t\t\t\terr instanceof FonderieApiError ? err : new FonderieApiError('unknown', String(err), 0);\n\t\t\terror.value = apiError;\n\t\t} finally {\n\t\t\tisLoading.value = false;\n\t\t}\n\t}\n\n\tasync function mutate<T>(op: () => Promise<T>): Promise<T> {\n\t\terror.value = null;\n\t\ttry {\n\t\t\treturn await op();\n\t\t} catch (err) {\n\t\t\tconst apiError =\n\t\t\t\terr instanceof FonderieApiError ? err : new FonderieApiError('unknown', String(err), 0);\n\t\t\terror.value = apiError;\n\t\t\tthrow apiError;\n\t\t}\n\t}\n\n\tfunction updateProfile(input: IUpdateProfileInput) {\n\t\treturn mutate(async () => {\n\t\t\tconst { result } = await auth.updateProfile(input);\n\t\t\tuser.value = result.user;\n\t\t\treturn result.user;\n\t\t});\n\t}\n\n\tfunction updatePreferences(input: IUpdatePreferencesInput) {\n\t\treturn mutate(async () => {\n\t\t\tconst { result } = await auth.updatePreferences(input);\n\t\t\tuser.value = result.user;\n\t\t\treturn result.user;\n\t\t});\n\t}\n\n\tfunction updateEmail(email: string) {\n\t\treturn mutate(async () => {\n\t\t\tawait auth.updateEmail(email);\n\t\t\tawait refresh();\n\t\t});\n\t}\n\n\tfunction updatePhone(phone: string) {\n\t\treturn mutate(async () => {\n\t\t\tawait auth.updatePhone(phone);\n\t\t\tawait refresh();\n\t\t});\n\t}\n\n\tonMounted(() => void refresh());\n\n\treturn { user, refresh, updateProfile, updatePreferences, updateEmail, updatePhone, isLoading, error };\n}\n","import type { AuthClient, IRegisterInput, IRegisterResult } from '@fonderie/client';\nimport { FonderieApiError } from '@fonderie/client';\nimport { useFonderieSubClient } from '@fonderie/vue';\nimport type { Ref } from 'vue';\nimport { ref } from 'vue';\nimport { persistToken } from '../storage';\n\nexport interface IUseRegisterReturn {\n\tregister: (input: IRegisterInput) => Promise<IRegisterResult>;\n\tisLoading: Ref<boolean>;\n\terror: Ref<FonderieApiError | null>;\n\tdata: Ref<IRegisterResult | null>;\n}\n\nexport function useRegister(client?: AuthClient): IUseRegisterReturn {\n\tconst auth = useFonderieSubClient(client, (c) => c.auth, 'useRegister');\n\tconst isLoading = ref(false);\n\tconst error = ref<FonderieApiError | null>(null);\n\tconst data = ref<IRegisterResult | null>(null);\n\n\tasync function register(input: IRegisterInput) {\n\t\tisLoading.value = true;\n\t\terror.value = null;\n\t\ttry {\n\t\t\tconst { result } = await auth.register(input);\n\t\t\tauth.setAccessToken(result.tokens.access);\n\t\t\tpersistToken(result.tokens.access);\n\t\t\tdata.value = result;\n\t\t\treturn result;\n\t\t} catch (err) {\n\t\t\tconst apiError =\n\t\t\t\terr instanceof FonderieApiError ? err : new FonderieApiError('unknown', String(err), 0);\n\t\t\terror.value = apiError;\n\t\t\tthrow apiError;\n\t\t} finally {\n\t\t\tisLoading.value = false;\n\t\t}\n\t}\n\n\treturn { register, isLoading, error, data };\n}\n","import type { AuthClient, IResetPasswordInput } from '@fonderie/client';\nimport { FonderieApiError } from '@fonderie/client';\nimport { useFonderieSubClient } from '@fonderie/vue';\nimport type { Ref } from 'vue';\nimport { ref } from 'vue';\n\nexport interface IUseResetPasswordReturn {\n\tresetPassword: (input: IResetPasswordInput) => Promise<void>;\n\tisLoading: Ref<boolean>;\n\terror: Ref<FonderieApiError | null>;\n\tdone: Ref<boolean>;\n}\n\nexport function useResetPassword(client?: AuthClient): IUseResetPasswordReturn {\n\tconst auth = useFonderieSubClient(client, (c) => c.auth, 'useResetPassword');\n\tconst isLoading = ref(false);\n\tconst error = ref<FonderieApiError | null>(null);\n\tconst done = ref(false);\n\n\tasync function resetPassword(input: IResetPasswordInput) {\n\t\tisLoading.value = true;\n\t\terror.value = null;\n\t\ttry {\n\t\t\tawait auth.resetPassword(input);\n\t\t\tdone.value = true;\n\t\t} catch (err) {\n\t\t\tconst apiError =\n\t\t\t\terr instanceof FonderieApiError ? err : new FonderieApiError('unknown', String(err), 0);\n\t\t\terror.value = apiError;\n\t\t\tthrow apiError;\n\t\t} finally {\n\t\t\tisLoading.value = false;\n\t\t}\n\t}\n\n\treturn { resetPassword, isLoading, error, done };\n}\n","import type { AuthClient, IUserDTO } from '@fonderie/client';\nimport { useFonderieSubClient } from '@fonderie/vue';\nimport type { Ref } from 'vue';\nimport { onMounted, ref } from 'vue';\nimport { clearToken, readToken } from '../storage';\n\nexport interface IUseSessionReturn {\n\tuser: Ref<IUserDTO | null>;\n\tisLoading: Ref<boolean>;\n\tisAuthenticated: Ref<boolean>;\n\trefresh: (opts?: { force?: boolean }) => Promise<void>;\n\tlogout: (refreshToken?: string) => Promise<void>;\n}\n\nexport function useSession(client?: AuthClient): IUseSessionReturn {\n\tconst auth = useFonderieSubClient(client, (c) => c.auth, 'useSession');\n\tconst user = ref<IUserDTO | null>(null);\n\tconst isLoading = ref(true);\n\tconst isAuthenticated = ref(false);\n\n\tasync function refresh(opts?: { force?: boolean }) {\n\t\tisLoading.value = true;\n\t\ttry {\n\t\t\tconst { result } = await auth.getUser({ bust: opts?.force });\n\t\t\tuser.value = result.user;\n\t\t\tisAuthenticated.value = true;\n\t\t} catch {\n\t\t\tuser.value = null;\n\t\t\tisAuthenticated.value = false;\n\t\t\tauth.setAccessToken(undefined);\n\t\t\tclearToken();\n\t\t} finally {\n\t\t\tisLoading.value = false;\n\t\t}\n\t}\n\n\tasync function logout(refreshToken?: string) {\n\t\ttry {\n\t\t\tawait auth.logout(refreshToken);\n\t\t} catch {\n\t\t\t// Session is being torn down regardless of server response.\n\t\t}\n\t\tauth.setAccessToken(undefined);\n\t\tclearToken();\n\t\tuser.value = null;\n\t\tisAuthenticated.value = false;\n\t}\n\n\tconst token = readToken();\n\tif (token) auth.setAccessToken(token);\n\tonMounted(() => void refresh());\n\n\treturn { user, isLoading, isAuthenticated, refresh, logout };\n}\n","import type { AuthClient, IVerifyEmailResult } from '@fonderie/client';\nimport { FonderieApiError } from '@fonderie/client';\nimport { useFonderieSubClient } from '@fonderie/vue';\nimport type { Ref } from 'vue';\nimport { ref } from 'vue';\n\nexport interface IUseVerifyEmailReturn {\n\tverifyEmail: (pin: string) => Promise<IVerifyEmailResult>;\n\tresend: () => Promise<void>;\n\tresent: Ref<boolean>;\n\tisLoading: Ref<boolean>;\n\terror: Ref<FonderieApiError | null>;\n\tdata: Ref<IVerifyEmailResult | null>;\n}\n\nexport function useVerifyEmail(client?: AuthClient): IUseVerifyEmailReturn {\n\tconst auth = useFonderieSubClient(client, (c) => c.auth, 'useVerifyEmail');\n\tconst isLoading = ref(false);\n\tconst error = ref<FonderieApiError | null>(null);\n\tconst data = ref<IVerifyEmailResult | null>(null);\n\tconst resent = ref(false);\n\n\t// Re-sends the verification email — the other half of the same lifecycle,\n\t// so one composable owns both and screens don't split loading/error handling.\n\tasync function resend() {\n\t\tisLoading.value = true;\n\t\terror.value = null;\n\t\tresent.value = false;\n\t\ttry {\n\t\t\tawait auth.sendVerificationEmail();\n\t\t\tresent.value = true;\n\t\t} catch (err) {\n\t\t\tconst apiError =\n\t\t\t\terr instanceof FonderieApiError ? err : new FonderieApiError('unknown', String(err), 0);\n\t\t\terror.value = apiError;\n\t\t\tthrow apiError;\n\t\t} finally {\n\t\t\tisLoading.value = false;\n\t\t}\n\t}\n\n\tasync function verifyEmail(pin: string) {\n\t\tisLoading.value = true;\n\t\terror.value = null;\n\t\ttry {\n\t\t\tconst { result } = await auth.verifyEmail(pin);\n\t\t\tdata.value = result;\n\t\t\treturn result;\n\t\t} catch (err) {\n\t\t\tconst apiError =\n\t\t\t\terr instanceof FonderieApiError ? err : new FonderieApiError('unknown', String(err), 0);\n\t\t\terror.value = apiError;\n\t\t\tthrow apiError;\n\t\t} finally {\n\t\t\tisLoading.value = false;\n\t\t}\n\t}\n\n\treturn { verifyEmail, resend, resent, isLoading, error, data };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAkBA,IAAAA,kBAAgD;;;ACjBhD,oBAAiC;AACjC,iBAAqC;AAErC,IAAAC,cAAoB;;;ACJb,IAAM,YAAY;AAElB,SAAS,aAAa,OAAe;AAC3C,eAAa,QAAQ,WAAW,KAAK;AACtC;AAEO,SAAS,aAAa;AAC5B,eAAa,WAAW,SAAS;AAClC;AAEO,SAAS,YAA2B;AAC1C,SAAO,aAAa,QAAQ,SAAS;AACtC;;;ADIO,SAAS,eAAe,QAA4C;AAC1E,QAAM,WAAO,iCAAqB,QAAQ,CAAC,MAAM,EAAE,MAAM,gBAAgB;AACzE,QAAM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QAAQ;AAAA,IACnB;AAAA,EACD;AAEA,iBAAe,YAAY,KAAa;AACvC,cAAU,QAAQ;AAClB,UAAM,QAAQ;AACd,QAAI;AACH,YAAM,EAAE,OAAO,IAAI,MAAM,KAAK,YAAY,GAAG;AAC7C,WAAK,QAAQ;AACb,aAAO;AAAA,IACR,SAAS,KAAK;AACb,YAAM,WACL,eAAe,mCAAmB,MAAM,IAAI,iCAAiB,WAAW,OAAO,GAAG,GAAG,CAAC;AACvF,YAAM,QAAQ;AACd,YAAM;AAAA,IACP,UAAE;AACD,gBAAU,QAAQ;AAAA,IACnB;AAAA,EACD;AAEA,SAAO,EAAE,aAAa,QAAQ,QAAQ,WAAW,OAAO,KAAK;AAC9D;","names":["import_client","import_vue","import_client","import_vue","import_client","import_vue","import_client","import_vue","import_client","import_vue","import_client","import_vue","import_client","import_vue","import_client","import_vue","import_client","import_vue","import_client","import_vue","import_vue","import_client","import_vue"]}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { FonderieApiError, AuthClient, IChangePasswordInput, ILoginInput, ILoginResult, IMfaRequiredResult, IMfaSetupResult, IMfaEnabledResult, IUserDTO, IUpdateProfileInput, IUpdatePreferencesInput, IRegisterInput, IRegisterResult, IResetPasswordInput, IVerifyEmailResult } from '@fonderie/client';
|
|
2
2
|
export { AuthClient, FonderieApiError, IChangePasswordInput, ILoginInput, ILoginResult, IMfaEnabledResult, IMfaRequiredResult, IMfaSetupResult, IRegisterInput, IRegisterResult, IResetPasswordInput, ITokens, IUpdatePreferencesInput, IUpdateProfileInput, IUserDTO, IVerifyEmailResult, isMfaRequired } from '@fonderie/client';
|
|
3
|
-
import * as vue from 'vue';
|
|
4
3
|
import { Ref } from 'vue';
|
|
5
4
|
|
|
6
5
|
interface IUseAccountDataReturn {
|
|
@@ -19,108 +18,29 @@ interface IUseChangePasswordReturn {
|
|
|
19
18
|
}
|
|
20
19
|
declare function useChangePassword(client?: AuthClient): IUseChangePasswordReturn;
|
|
21
20
|
|
|
22
|
-
|
|
21
|
+
interface IUseForgotPasswordReturn {
|
|
23
22
|
forgotPassword: (email: string) => Promise<void>;
|
|
24
|
-
isLoading:
|
|
25
|
-
error:
|
|
26
|
-
sent:
|
|
27
|
-
}
|
|
23
|
+
isLoading: Ref<boolean>;
|
|
24
|
+
error: Ref<FonderieApiError | null>;
|
|
25
|
+
sent: Ref<boolean>;
|
|
26
|
+
}
|
|
27
|
+
declare function useForgotPassword(client?: AuthClient): IUseForgotPasswordReturn;
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
interface IUseLoginReturn {
|
|
30
30
|
login: (input: ILoginInput) => Promise<ILoginResult | IMfaRequiredResult>;
|
|
31
|
-
isLoading:
|
|
32
|
-
error:
|
|
33
|
-
data:
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
};
|
|
38
|
-
user: {
|
|
39
|
-
id: string;
|
|
40
|
-
email: string;
|
|
41
|
-
firstName: string;
|
|
42
|
-
lastName: string;
|
|
43
|
-
phone: string;
|
|
44
|
-
profileImageUrl: string;
|
|
45
|
-
isActive: boolean;
|
|
46
|
-
lastLogin: string;
|
|
47
|
-
skills: {
|
|
48
|
-
name: string;
|
|
49
|
-
level: string;
|
|
50
|
-
}[];
|
|
51
|
-
preferences: {
|
|
52
|
-
locale: string;
|
|
53
|
-
timezone: string;
|
|
54
|
-
notifications: {
|
|
55
|
-
email: boolean;
|
|
56
|
-
inApp: boolean;
|
|
57
|
-
sms: boolean;
|
|
58
|
-
push: boolean;
|
|
59
|
-
};
|
|
60
|
-
emailDigest: string;
|
|
61
|
-
dateFormat: string;
|
|
62
|
-
timeFormat: string;
|
|
63
|
-
};
|
|
64
|
-
isEmailVerified: boolean;
|
|
65
|
-
mfaEnabled: boolean;
|
|
66
|
-
suspended: boolean;
|
|
67
|
-
whitelist: boolean;
|
|
68
|
-
ipWhitelist: string[];
|
|
69
|
-
createdAt: string;
|
|
70
|
-
updatedAt: string;
|
|
71
|
-
};
|
|
72
|
-
} | null, ILoginResult | {
|
|
73
|
-
tokens: {
|
|
74
|
-
access: string;
|
|
75
|
-
refresh: string;
|
|
76
|
-
};
|
|
77
|
-
user: {
|
|
78
|
-
id: string;
|
|
79
|
-
email: string;
|
|
80
|
-
firstName: string;
|
|
81
|
-
lastName: string;
|
|
82
|
-
phone: string;
|
|
83
|
-
profileImageUrl: string;
|
|
84
|
-
isActive: boolean;
|
|
85
|
-
lastLogin: string;
|
|
86
|
-
skills: {
|
|
87
|
-
name: string;
|
|
88
|
-
level: string;
|
|
89
|
-
}[];
|
|
90
|
-
preferences: {
|
|
91
|
-
locale: string;
|
|
92
|
-
timezone: string;
|
|
93
|
-
notifications: {
|
|
94
|
-
email: boolean;
|
|
95
|
-
inApp: boolean;
|
|
96
|
-
sms: boolean;
|
|
97
|
-
push: boolean;
|
|
98
|
-
};
|
|
99
|
-
emailDigest: string;
|
|
100
|
-
dateFormat: string;
|
|
101
|
-
timeFormat: string;
|
|
102
|
-
};
|
|
103
|
-
isEmailVerified: boolean;
|
|
104
|
-
mfaEnabled: boolean;
|
|
105
|
-
suspended: boolean;
|
|
106
|
-
whitelist: boolean;
|
|
107
|
-
ipWhitelist: string[];
|
|
108
|
-
createdAt: string;
|
|
109
|
-
updatedAt: string;
|
|
110
|
-
};
|
|
111
|
-
} | null>;
|
|
112
|
-
mfaPending: vue.Ref<{
|
|
113
|
-
mfaToken: string;
|
|
114
|
-
} | null, IMfaRequiredResult | {
|
|
115
|
-
mfaToken: string;
|
|
116
|
-
} | null>;
|
|
117
|
-
};
|
|
31
|
+
isLoading: Ref<boolean>;
|
|
32
|
+
error: Ref<FonderieApiError | null>;
|
|
33
|
+
data: Ref<ILoginResult | null>;
|
|
34
|
+
mfaPending: Ref<IMfaRequiredResult | null>;
|
|
35
|
+
}
|
|
36
|
+
declare function useLogin(client?: AuthClient): IUseLoginReturn;
|
|
118
37
|
|
|
119
|
-
|
|
38
|
+
interface IUseLogoutReturn {
|
|
120
39
|
logout: (refreshToken?: string) => Promise<void>;
|
|
121
|
-
isLoading:
|
|
122
|
-
error:
|
|
123
|
-
}
|
|
40
|
+
isLoading: Ref<boolean>;
|
|
41
|
+
error: Ref<FonderieApiError | null>;
|
|
42
|
+
}
|
|
43
|
+
declare function useLogout(client?: AuthClient): IUseLogoutReturn;
|
|
124
44
|
|
|
125
45
|
interface IUseMfaLoginReturn {
|
|
126
46
|
verifyLogin: (mfaToken: string, code: string) => Promise<ILoginResult>;
|
|
@@ -155,192 +75,46 @@ interface IUseProfileReturn {
|
|
|
155
75
|
}
|
|
156
76
|
declare function useProfile(client?: AuthClient): IUseProfileReturn;
|
|
157
77
|
|
|
158
|
-
|
|
78
|
+
interface IUseRegisterReturn {
|
|
159
79
|
register: (input: IRegisterInput) => Promise<IRegisterResult>;
|
|
160
|
-
isLoading:
|
|
161
|
-
error:
|
|
162
|
-
data:
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
refresh: string;
|
|
166
|
-
};
|
|
167
|
-
user: {
|
|
168
|
-
id: string;
|
|
169
|
-
email: string;
|
|
170
|
-
firstName: string;
|
|
171
|
-
lastName: string;
|
|
172
|
-
phone: string;
|
|
173
|
-
profileImageUrl: string;
|
|
174
|
-
isActive: boolean;
|
|
175
|
-
lastLogin: string;
|
|
176
|
-
skills: {
|
|
177
|
-
name: string;
|
|
178
|
-
level: string;
|
|
179
|
-
}[];
|
|
180
|
-
preferences: {
|
|
181
|
-
locale: string;
|
|
182
|
-
timezone: string;
|
|
183
|
-
notifications: {
|
|
184
|
-
email: boolean;
|
|
185
|
-
inApp: boolean;
|
|
186
|
-
sms: boolean;
|
|
187
|
-
push: boolean;
|
|
188
|
-
};
|
|
189
|
-
emailDigest: string;
|
|
190
|
-
dateFormat: string;
|
|
191
|
-
timeFormat: string;
|
|
192
|
-
};
|
|
193
|
-
isEmailVerified: boolean;
|
|
194
|
-
mfaEnabled: boolean;
|
|
195
|
-
suspended: boolean;
|
|
196
|
-
whitelist: boolean;
|
|
197
|
-
ipWhitelist: string[];
|
|
198
|
-
createdAt: string;
|
|
199
|
-
updatedAt: string;
|
|
200
|
-
};
|
|
201
|
-
} | null, IRegisterResult | {
|
|
202
|
-
tokens: {
|
|
203
|
-
access: string;
|
|
204
|
-
refresh: string;
|
|
205
|
-
};
|
|
206
|
-
user: {
|
|
207
|
-
id: string;
|
|
208
|
-
email: string;
|
|
209
|
-
firstName: string;
|
|
210
|
-
lastName: string;
|
|
211
|
-
phone: string;
|
|
212
|
-
profileImageUrl: string;
|
|
213
|
-
isActive: boolean;
|
|
214
|
-
lastLogin: string;
|
|
215
|
-
skills: {
|
|
216
|
-
name: string;
|
|
217
|
-
level: string;
|
|
218
|
-
}[];
|
|
219
|
-
preferences: {
|
|
220
|
-
locale: string;
|
|
221
|
-
timezone: string;
|
|
222
|
-
notifications: {
|
|
223
|
-
email: boolean;
|
|
224
|
-
inApp: boolean;
|
|
225
|
-
sms: boolean;
|
|
226
|
-
push: boolean;
|
|
227
|
-
};
|
|
228
|
-
emailDigest: string;
|
|
229
|
-
dateFormat: string;
|
|
230
|
-
timeFormat: string;
|
|
231
|
-
};
|
|
232
|
-
isEmailVerified: boolean;
|
|
233
|
-
mfaEnabled: boolean;
|
|
234
|
-
suspended: boolean;
|
|
235
|
-
whitelist: boolean;
|
|
236
|
-
ipWhitelist: string[];
|
|
237
|
-
createdAt: string;
|
|
238
|
-
updatedAt: string;
|
|
239
|
-
};
|
|
240
|
-
} | null>;
|
|
241
|
-
};
|
|
80
|
+
isLoading: Ref<boolean>;
|
|
81
|
+
error: Ref<FonderieApiError | null>;
|
|
82
|
+
data: Ref<IRegisterResult | null>;
|
|
83
|
+
}
|
|
84
|
+
declare function useRegister(client?: AuthClient): IUseRegisterReturn;
|
|
242
85
|
|
|
243
|
-
|
|
86
|
+
interface IUseResetPasswordReturn {
|
|
244
87
|
resetPassword: (input: IResetPasswordInput) => Promise<void>;
|
|
245
|
-
isLoading:
|
|
246
|
-
error:
|
|
247
|
-
done:
|
|
248
|
-
}
|
|
88
|
+
isLoading: Ref<boolean>;
|
|
89
|
+
error: Ref<FonderieApiError | null>;
|
|
90
|
+
done: Ref<boolean>;
|
|
91
|
+
}
|
|
92
|
+
declare function useResetPassword(client?: AuthClient): IUseResetPasswordReturn;
|
|
249
93
|
|
|
250
|
-
|
|
251
|
-
user:
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
firstName: string;
|
|
255
|
-
lastName: string;
|
|
256
|
-
phone: string;
|
|
257
|
-
profileImageUrl: string;
|
|
258
|
-
isActive: boolean;
|
|
259
|
-
lastLogin: string;
|
|
260
|
-
skills: {
|
|
261
|
-
name: string;
|
|
262
|
-
level: string;
|
|
263
|
-
}[];
|
|
264
|
-
preferences: {
|
|
265
|
-
locale: string;
|
|
266
|
-
timezone: string;
|
|
267
|
-
notifications: {
|
|
268
|
-
email: boolean;
|
|
269
|
-
inApp: boolean;
|
|
270
|
-
sms: boolean;
|
|
271
|
-
push: boolean;
|
|
272
|
-
};
|
|
273
|
-
emailDigest: string;
|
|
274
|
-
dateFormat: string;
|
|
275
|
-
timeFormat: string;
|
|
276
|
-
};
|
|
277
|
-
isEmailVerified: boolean;
|
|
278
|
-
mfaEnabled: boolean;
|
|
279
|
-
suspended: boolean;
|
|
280
|
-
whitelist: boolean;
|
|
281
|
-
ipWhitelist: string[];
|
|
282
|
-
createdAt: string;
|
|
283
|
-
updatedAt: string;
|
|
284
|
-
} | null, IUserDTO | {
|
|
285
|
-
id: string;
|
|
286
|
-
email: string;
|
|
287
|
-
firstName: string;
|
|
288
|
-
lastName: string;
|
|
289
|
-
phone: string;
|
|
290
|
-
profileImageUrl: string;
|
|
291
|
-
isActive: boolean;
|
|
292
|
-
lastLogin: string;
|
|
293
|
-
skills: {
|
|
294
|
-
name: string;
|
|
295
|
-
level: string;
|
|
296
|
-
}[];
|
|
297
|
-
preferences: {
|
|
298
|
-
locale: string;
|
|
299
|
-
timezone: string;
|
|
300
|
-
notifications: {
|
|
301
|
-
email: boolean;
|
|
302
|
-
inApp: boolean;
|
|
303
|
-
sms: boolean;
|
|
304
|
-
push: boolean;
|
|
305
|
-
};
|
|
306
|
-
emailDigest: string;
|
|
307
|
-
dateFormat: string;
|
|
308
|
-
timeFormat: string;
|
|
309
|
-
};
|
|
310
|
-
isEmailVerified: boolean;
|
|
311
|
-
mfaEnabled: boolean;
|
|
312
|
-
suspended: boolean;
|
|
313
|
-
whitelist: boolean;
|
|
314
|
-
ipWhitelist: string[];
|
|
315
|
-
createdAt: string;
|
|
316
|
-
updatedAt: string;
|
|
317
|
-
} | null>;
|
|
318
|
-
isLoading: vue.Ref<boolean, boolean>;
|
|
319
|
-
isAuthenticated: vue.Ref<boolean, boolean>;
|
|
94
|
+
interface IUseSessionReturn {
|
|
95
|
+
user: Ref<IUserDTO | null>;
|
|
96
|
+
isLoading: Ref<boolean>;
|
|
97
|
+
isAuthenticated: Ref<boolean>;
|
|
320
98
|
refresh: (opts?: {
|
|
321
99
|
force?: boolean;
|
|
322
100
|
}) => Promise<void>;
|
|
323
101
|
logout: (refreshToken?: string) => Promise<void>;
|
|
324
|
-
}
|
|
102
|
+
}
|
|
103
|
+
declare function useSession(client?: AuthClient): IUseSessionReturn;
|
|
325
104
|
|
|
326
|
-
|
|
105
|
+
interface IUseVerifyEmailReturn {
|
|
327
106
|
verifyEmail: (pin: string) => Promise<IVerifyEmailResult>;
|
|
328
107
|
resend: () => Promise<void>;
|
|
329
|
-
resent:
|
|
330
|
-
isLoading:
|
|
331
|
-
error:
|
|
332
|
-
data:
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
} | null, IVerifyEmailResult | {
|
|
336
|
-
verified: boolean;
|
|
337
|
-
email: string;
|
|
338
|
-
} | null>;
|
|
339
|
-
};
|
|
108
|
+
resent: Ref<boolean>;
|
|
109
|
+
isLoading: Ref<boolean>;
|
|
110
|
+
error: Ref<FonderieApiError | null>;
|
|
111
|
+
data: Ref<IVerifyEmailResult | null>;
|
|
112
|
+
}
|
|
113
|
+
declare function useVerifyEmail(client?: AuthClient): IUseVerifyEmailReturn;
|
|
340
114
|
|
|
341
115
|
declare const TOKEN_KEY = "fonderie_access_token";
|
|
342
116
|
declare function persistToken(token: string): void;
|
|
343
117
|
declare function clearToken(): void;
|
|
344
118
|
declare function readToken(): string | null;
|
|
345
119
|
|
|
346
|
-
export { type IUseAccountDataReturn, type IUseChangePasswordReturn, type IUseMfaLoginReturn, type IUseMfaSetupReturn, type IUseProfileReturn, TOKEN_KEY, clearToken, persistToken, readToken, useAccountData, useChangePassword, useForgotPassword, useLogin, useLogout, useMfaLogin, useMfaSetup, useProfile, useRegister, useResetPassword, useSession, useVerifyEmail };
|
|
120
|
+
export { type IUseAccountDataReturn, type IUseChangePasswordReturn, type IUseForgotPasswordReturn, type IUseLoginReturn, type IUseLogoutReturn, type IUseMfaLoginReturn, type IUseMfaSetupReturn, type IUseProfileReturn, type IUseRegisterReturn, type IUseResetPasswordReturn, type IUseSessionReturn, type IUseVerifyEmailReturn, TOKEN_KEY, clearToken, persistToken, readToken, useAccountData, useChangePassword, useForgotPassword, useLogin, useLogout, useMfaLogin, useMfaSetup, useProfile, useRegister, useResetPassword, useSession, useVerifyEmail };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { FonderieApiError, AuthClient, IChangePasswordInput, ILoginInput, ILoginResult, IMfaRequiredResult, IMfaSetupResult, IMfaEnabledResult, IUserDTO, IUpdateProfileInput, IUpdatePreferencesInput, IRegisterInput, IRegisterResult, IResetPasswordInput, IVerifyEmailResult } from '@fonderie/client';
|
|
2
2
|
export { AuthClient, FonderieApiError, IChangePasswordInput, ILoginInput, ILoginResult, IMfaEnabledResult, IMfaRequiredResult, IMfaSetupResult, IRegisterInput, IRegisterResult, IResetPasswordInput, ITokens, IUpdatePreferencesInput, IUpdateProfileInput, IUserDTO, IVerifyEmailResult, isMfaRequired } from '@fonderie/client';
|
|
3
|
-
import * as vue from 'vue';
|
|
4
3
|
import { Ref } from 'vue';
|
|
5
4
|
|
|
6
5
|
interface IUseAccountDataReturn {
|
|
@@ -19,108 +18,29 @@ interface IUseChangePasswordReturn {
|
|
|
19
18
|
}
|
|
20
19
|
declare function useChangePassword(client?: AuthClient): IUseChangePasswordReturn;
|
|
21
20
|
|
|
22
|
-
|
|
21
|
+
interface IUseForgotPasswordReturn {
|
|
23
22
|
forgotPassword: (email: string) => Promise<void>;
|
|
24
|
-
isLoading:
|
|
25
|
-
error:
|
|
26
|
-
sent:
|
|
27
|
-
}
|
|
23
|
+
isLoading: Ref<boolean>;
|
|
24
|
+
error: Ref<FonderieApiError | null>;
|
|
25
|
+
sent: Ref<boolean>;
|
|
26
|
+
}
|
|
27
|
+
declare function useForgotPassword(client?: AuthClient): IUseForgotPasswordReturn;
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
interface IUseLoginReturn {
|
|
30
30
|
login: (input: ILoginInput) => Promise<ILoginResult | IMfaRequiredResult>;
|
|
31
|
-
isLoading:
|
|
32
|
-
error:
|
|
33
|
-
data:
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
};
|
|
38
|
-
user: {
|
|
39
|
-
id: string;
|
|
40
|
-
email: string;
|
|
41
|
-
firstName: string;
|
|
42
|
-
lastName: string;
|
|
43
|
-
phone: string;
|
|
44
|
-
profileImageUrl: string;
|
|
45
|
-
isActive: boolean;
|
|
46
|
-
lastLogin: string;
|
|
47
|
-
skills: {
|
|
48
|
-
name: string;
|
|
49
|
-
level: string;
|
|
50
|
-
}[];
|
|
51
|
-
preferences: {
|
|
52
|
-
locale: string;
|
|
53
|
-
timezone: string;
|
|
54
|
-
notifications: {
|
|
55
|
-
email: boolean;
|
|
56
|
-
inApp: boolean;
|
|
57
|
-
sms: boolean;
|
|
58
|
-
push: boolean;
|
|
59
|
-
};
|
|
60
|
-
emailDigest: string;
|
|
61
|
-
dateFormat: string;
|
|
62
|
-
timeFormat: string;
|
|
63
|
-
};
|
|
64
|
-
isEmailVerified: boolean;
|
|
65
|
-
mfaEnabled: boolean;
|
|
66
|
-
suspended: boolean;
|
|
67
|
-
whitelist: boolean;
|
|
68
|
-
ipWhitelist: string[];
|
|
69
|
-
createdAt: string;
|
|
70
|
-
updatedAt: string;
|
|
71
|
-
};
|
|
72
|
-
} | null, ILoginResult | {
|
|
73
|
-
tokens: {
|
|
74
|
-
access: string;
|
|
75
|
-
refresh: string;
|
|
76
|
-
};
|
|
77
|
-
user: {
|
|
78
|
-
id: string;
|
|
79
|
-
email: string;
|
|
80
|
-
firstName: string;
|
|
81
|
-
lastName: string;
|
|
82
|
-
phone: string;
|
|
83
|
-
profileImageUrl: string;
|
|
84
|
-
isActive: boolean;
|
|
85
|
-
lastLogin: string;
|
|
86
|
-
skills: {
|
|
87
|
-
name: string;
|
|
88
|
-
level: string;
|
|
89
|
-
}[];
|
|
90
|
-
preferences: {
|
|
91
|
-
locale: string;
|
|
92
|
-
timezone: string;
|
|
93
|
-
notifications: {
|
|
94
|
-
email: boolean;
|
|
95
|
-
inApp: boolean;
|
|
96
|
-
sms: boolean;
|
|
97
|
-
push: boolean;
|
|
98
|
-
};
|
|
99
|
-
emailDigest: string;
|
|
100
|
-
dateFormat: string;
|
|
101
|
-
timeFormat: string;
|
|
102
|
-
};
|
|
103
|
-
isEmailVerified: boolean;
|
|
104
|
-
mfaEnabled: boolean;
|
|
105
|
-
suspended: boolean;
|
|
106
|
-
whitelist: boolean;
|
|
107
|
-
ipWhitelist: string[];
|
|
108
|
-
createdAt: string;
|
|
109
|
-
updatedAt: string;
|
|
110
|
-
};
|
|
111
|
-
} | null>;
|
|
112
|
-
mfaPending: vue.Ref<{
|
|
113
|
-
mfaToken: string;
|
|
114
|
-
} | null, IMfaRequiredResult | {
|
|
115
|
-
mfaToken: string;
|
|
116
|
-
} | null>;
|
|
117
|
-
};
|
|
31
|
+
isLoading: Ref<boolean>;
|
|
32
|
+
error: Ref<FonderieApiError | null>;
|
|
33
|
+
data: Ref<ILoginResult | null>;
|
|
34
|
+
mfaPending: Ref<IMfaRequiredResult | null>;
|
|
35
|
+
}
|
|
36
|
+
declare function useLogin(client?: AuthClient): IUseLoginReturn;
|
|
118
37
|
|
|
119
|
-
|
|
38
|
+
interface IUseLogoutReturn {
|
|
120
39
|
logout: (refreshToken?: string) => Promise<void>;
|
|
121
|
-
isLoading:
|
|
122
|
-
error:
|
|
123
|
-
}
|
|
40
|
+
isLoading: Ref<boolean>;
|
|
41
|
+
error: Ref<FonderieApiError | null>;
|
|
42
|
+
}
|
|
43
|
+
declare function useLogout(client?: AuthClient): IUseLogoutReturn;
|
|
124
44
|
|
|
125
45
|
interface IUseMfaLoginReturn {
|
|
126
46
|
verifyLogin: (mfaToken: string, code: string) => Promise<ILoginResult>;
|
|
@@ -155,192 +75,46 @@ interface IUseProfileReturn {
|
|
|
155
75
|
}
|
|
156
76
|
declare function useProfile(client?: AuthClient): IUseProfileReturn;
|
|
157
77
|
|
|
158
|
-
|
|
78
|
+
interface IUseRegisterReturn {
|
|
159
79
|
register: (input: IRegisterInput) => Promise<IRegisterResult>;
|
|
160
|
-
isLoading:
|
|
161
|
-
error:
|
|
162
|
-
data:
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
refresh: string;
|
|
166
|
-
};
|
|
167
|
-
user: {
|
|
168
|
-
id: string;
|
|
169
|
-
email: string;
|
|
170
|
-
firstName: string;
|
|
171
|
-
lastName: string;
|
|
172
|
-
phone: string;
|
|
173
|
-
profileImageUrl: string;
|
|
174
|
-
isActive: boolean;
|
|
175
|
-
lastLogin: string;
|
|
176
|
-
skills: {
|
|
177
|
-
name: string;
|
|
178
|
-
level: string;
|
|
179
|
-
}[];
|
|
180
|
-
preferences: {
|
|
181
|
-
locale: string;
|
|
182
|
-
timezone: string;
|
|
183
|
-
notifications: {
|
|
184
|
-
email: boolean;
|
|
185
|
-
inApp: boolean;
|
|
186
|
-
sms: boolean;
|
|
187
|
-
push: boolean;
|
|
188
|
-
};
|
|
189
|
-
emailDigest: string;
|
|
190
|
-
dateFormat: string;
|
|
191
|
-
timeFormat: string;
|
|
192
|
-
};
|
|
193
|
-
isEmailVerified: boolean;
|
|
194
|
-
mfaEnabled: boolean;
|
|
195
|
-
suspended: boolean;
|
|
196
|
-
whitelist: boolean;
|
|
197
|
-
ipWhitelist: string[];
|
|
198
|
-
createdAt: string;
|
|
199
|
-
updatedAt: string;
|
|
200
|
-
};
|
|
201
|
-
} | null, IRegisterResult | {
|
|
202
|
-
tokens: {
|
|
203
|
-
access: string;
|
|
204
|
-
refresh: string;
|
|
205
|
-
};
|
|
206
|
-
user: {
|
|
207
|
-
id: string;
|
|
208
|
-
email: string;
|
|
209
|
-
firstName: string;
|
|
210
|
-
lastName: string;
|
|
211
|
-
phone: string;
|
|
212
|
-
profileImageUrl: string;
|
|
213
|
-
isActive: boolean;
|
|
214
|
-
lastLogin: string;
|
|
215
|
-
skills: {
|
|
216
|
-
name: string;
|
|
217
|
-
level: string;
|
|
218
|
-
}[];
|
|
219
|
-
preferences: {
|
|
220
|
-
locale: string;
|
|
221
|
-
timezone: string;
|
|
222
|
-
notifications: {
|
|
223
|
-
email: boolean;
|
|
224
|
-
inApp: boolean;
|
|
225
|
-
sms: boolean;
|
|
226
|
-
push: boolean;
|
|
227
|
-
};
|
|
228
|
-
emailDigest: string;
|
|
229
|
-
dateFormat: string;
|
|
230
|
-
timeFormat: string;
|
|
231
|
-
};
|
|
232
|
-
isEmailVerified: boolean;
|
|
233
|
-
mfaEnabled: boolean;
|
|
234
|
-
suspended: boolean;
|
|
235
|
-
whitelist: boolean;
|
|
236
|
-
ipWhitelist: string[];
|
|
237
|
-
createdAt: string;
|
|
238
|
-
updatedAt: string;
|
|
239
|
-
};
|
|
240
|
-
} | null>;
|
|
241
|
-
};
|
|
80
|
+
isLoading: Ref<boolean>;
|
|
81
|
+
error: Ref<FonderieApiError | null>;
|
|
82
|
+
data: Ref<IRegisterResult | null>;
|
|
83
|
+
}
|
|
84
|
+
declare function useRegister(client?: AuthClient): IUseRegisterReturn;
|
|
242
85
|
|
|
243
|
-
|
|
86
|
+
interface IUseResetPasswordReturn {
|
|
244
87
|
resetPassword: (input: IResetPasswordInput) => Promise<void>;
|
|
245
|
-
isLoading:
|
|
246
|
-
error:
|
|
247
|
-
done:
|
|
248
|
-
}
|
|
88
|
+
isLoading: Ref<boolean>;
|
|
89
|
+
error: Ref<FonderieApiError | null>;
|
|
90
|
+
done: Ref<boolean>;
|
|
91
|
+
}
|
|
92
|
+
declare function useResetPassword(client?: AuthClient): IUseResetPasswordReturn;
|
|
249
93
|
|
|
250
|
-
|
|
251
|
-
user:
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
firstName: string;
|
|
255
|
-
lastName: string;
|
|
256
|
-
phone: string;
|
|
257
|
-
profileImageUrl: string;
|
|
258
|
-
isActive: boolean;
|
|
259
|
-
lastLogin: string;
|
|
260
|
-
skills: {
|
|
261
|
-
name: string;
|
|
262
|
-
level: string;
|
|
263
|
-
}[];
|
|
264
|
-
preferences: {
|
|
265
|
-
locale: string;
|
|
266
|
-
timezone: string;
|
|
267
|
-
notifications: {
|
|
268
|
-
email: boolean;
|
|
269
|
-
inApp: boolean;
|
|
270
|
-
sms: boolean;
|
|
271
|
-
push: boolean;
|
|
272
|
-
};
|
|
273
|
-
emailDigest: string;
|
|
274
|
-
dateFormat: string;
|
|
275
|
-
timeFormat: string;
|
|
276
|
-
};
|
|
277
|
-
isEmailVerified: boolean;
|
|
278
|
-
mfaEnabled: boolean;
|
|
279
|
-
suspended: boolean;
|
|
280
|
-
whitelist: boolean;
|
|
281
|
-
ipWhitelist: string[];
|
|
282
|
-
createdAt: string;
|
|
283
|
-
updatedAt: string;
|
|
284
|
-
} | null, IUserDTO | {
|
|
285
|
-
id: string;
|
|
286
|
-
email: string;
|
|
287
|
-
firstName: string;
|
|
288
|
-
lastName: string;
|
|
289
|
-
phone: string;
|
|
290
|
-
profileImageUrl: string;
|
|
291
|
-
isActive: boolean;
|
|
292
|
-
lastLogin: string;
|
|
293
|
-
skills: {
|
|
294
|
-
name: string;
|
|
295
|
-
level: string;
|
|
296
|
-
}[];
|
|
297
|
-
preferences: {
|
|
298
|
-
locale: string;
|
|
299
|
-
timezone: string;
|
|
300
|
-
notifications: {
|
|
301
|
-
email: boolean;
|
|
302
|
-
inApp: boolean;
|
|
303
|
-
sms: boolean;
|
|
304
|
-
push: boolean;
|
|
305
|
-
};
|
|
306
|
-
emailDigest: string;
|
|
307
|
-
dateFormat: string;
|
|
308
|
-
timeFormat: string;
|
|
309
|
-
};
|
|
310
|
-
isEmailVerified: boolean;
|
|
311
|
-
mfaEnabled: boolean;
|
|
312
|
-
suspended: boolean;
|
|
313
|
-
whitelist: boolean;
|
|
314
|
-
ipWhitelist: string[];
|
|
315
|
-
createdAt: string;
|
|
316
|
-
updatedAt: string;
|
|
317
|
-
} | null>;
|
|
318
|
-
isLoading: vue.Ref<boolean, boolean>;
|
|
319
|
-
isAuthenticated: vue.Ref<boolean, boolean>;
|
|
94
|
+
interface IUseSessionReturn {
|
|
95
|
+
user: Ref<IUserDTO | null>;
|
|
96
|
+
isLoading: Ref<boolean>;
|
|
97
|
+
isAuthenticated: Ref<boolean>;
|
|
320
98
|
refresh: (opts?: {
|
|
321
99
|
force?: boolean;
|
|
322
100
|
}) => Promise<void>;
|
|
323
101
|
logout: (refreshToken?: string) => Promise<void>;
|
|
324
|
-
}
|
|
102
|
+
}
|
|
103
|
+
declare function useSession(client?: AuthClient): IUseSessionReturn;
|
|
325
104
|
|
|
326
|
-
|
|
105
|
+
interface IUseVerifyEmailReturn {
|
|
327
106
|
verifyEmail: (pin: string) => Promise<IVerifyEmailResult>;
|
|
328
107
|
resend: () => Promise<void>;
|
|
329
|
-
resent:
|
|
330
|
-
isLoading:
|
|
331
|
-
error:
|
|
332
|
-
data:
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
} | null, IVerifyEmailResult | {
|
|
336
|
-
verified: boolean;
|
|
337
|
-
email: string;
|
|
338
|
-
} | null>;
|
|
339
|
-
};
|
|
108
|
+
resent: Ref<boolean>;
|
|
109
|
+
isLoading: Ref<boolean>;
|
|
110
|
+
error: Ref<FonderieApiError | null>;
|
|
111
|
+
data: Ref<IVerifyEmailResult | null>;
|
|
112
|
+
}
|
|
113
|
+
declare function useVerifyEmail(client?: AuthClient): IUseVerifyEmailReturn;
|
|
340
114
|
|
|
341
115
|
declare const TOKEN_KEY = "fonderie_access_token";
|
|
342
116
|
declare function persistToken(token: string): void;
|
|
343
117
|
declare function clearToken(): void;
|
|
344
118
|
declare function readToken(): string | null;
|
|
345
119
|
|
|
346
|
-
export { type IUseAccountDataReturn, type IUseChangePasswordReturn, type IUseMfaLoginReturn, type IUseMfaSetupReturn, type IUseProfileReturn, TOKEN_KEY, clearToken, persistToken, readToken, useAccountData, useChangePassword, useForgotPassword, useLogin, useLogout, useMfaLogin, useMfaSetup, useProfile, useRegister, useResetPassword, useSession, useVerifyEmail };
|
|
120
|
+
export { type IUseAccountDataReturn, type IUseChangePasswordReturn, type IUseForgotPasswordReturn, type IUseLoginReturn, type IUseLogoutReturn, type IUseMfaLoginReturn, type IUseMfaSetupReturn, type IUseProfileReturn, type IUseRegisterReturn, type IUseResetPasswordReturn, type IUseSessionReturn, type IUseVerifyEmailReturn, TOKEN_KEY, clearToken, persistToken, readToken, useAccountData, useChangePassword, useForgotPassword, useLogin, useLogout, useMfaLogin, useMfaSetup, useProfile, useRegister, useResetPassword, useSession, useVerifyEmail };
|
package/dist/index.js
CHANGED
|
@@ -248,7 +248,7 @@ function useMfaSetup(client) {
|
|
|
248
248
|
// src/composables/useProfile.ts
|
|
249
249
|
import { FonderieApiError as FonderieApiError8 } from "@fonderie/client";
|
|
250
250
|
import { useFonderieSubClient as useFonderieSubClient8 } from "@fonderie/vue";
|
|
251
|
-
import { ref as ref8 } from "vue";
|
|
251
|
+
import { onMounted, ref as ref8 } from "vue";
|
|
252
252
|
function useProfile(client) {
|
|
253
253
|
const auth = useFonderieSubClient8(client, (c) => c.auth, "useProfile");
|
|
254
254
|
const user = ref8(null);
|
|
@@ -303,7 +303,7 @@ function useProfile(client) {
|
|
|
303
303
|
await refresh();
|
|
304
304
|
});
|
|
305
305
|
}
|
|
306
|
-
void refresh();
|
|
306
|
+
onMounted(() => void refresh());
|
|
307
307
|
return { user, refresh, updateProfile, updatePreferences, updateEmail, updatePhone, isLoading, error };
|
|
308
308
|
}
|
|
309
309
|
|
|
@@ -364,7 +364,7 @@ function useResetPassword(client) {
|
|
|
364
364
|
|
|
365
365
|
// src/composables/useSession.ts
|
|
366
366
|
import { useFonderieSubClient as useFonderieSubClient11 } from "@fonderie/vue";
|
|
367
|
-
import { ref as ref11 } from "vue";
|
|
367
|
+
import { onMounted as onMounted2, ref as ref11 } from "vue";
|
|
368
368
|
function useSession(client) {
|
|
369
369
|
const auth = useFonderieSubClient11(client, (c) => c.auth, "useSession");
|
|
370
370
|
const user = ref11(null);
|
|
@@ -397,7 +397,7 @@ function useSession(client) {
|
|
|
397
397
|
}
|
|
398
398
|
const token = readToken();
|
|
399
399
|
if (token) auth.setAccessToken(token);
|
|
400
|
-
void refresh();
|
|
400
|
+
onMounted2(() => void refresh());
|
|
401
401
|
return { user, isLoading, isAuthenticated, refresh, logout };
|
|
402
402
|
}
|
|
403
403
|
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/composables/useAccountData.ts","../src/storage.ts","../src/composables/useChangePassword.ts","../src/composables/useForgotPassword.ts","../src/composables/useLogin.ts","../src/composables/useLogout.ts","../src/composables/useMfaLogin.ts","../src/composables/useMfaSetup.ts","../src/composables/useProfile.ts","../src/composables/useRegister.ts","../src/composables/useResetPassword.ts","../src/composables/useSession.ts","../src/composables/useVerifyEmail.ts"],"sourcesContent":["export type {\n\tAuthClient,\n\tIChangePasswordInput,\n\tILoginInput,\n\tILoginResult,\n\tIMfaEnabledResult,\n\tIMfaRequiredResult,\n\tIMfaSetupResult,\n\tIRegisterInput,\n\tIRegisterResult,\n\tIResetPasswordInput,\n\tITokens,\n\tIUpdatePreferencesInput,\n\tIUpdateProfileInput,\n\tIUserDTO,\n\tIVerifyEmailResult,\n} from '@fonderie/client';\n\nexport { FonderieApiError, isMfaRequired } from '@fonderie/client';\n\nexport type {\n\tIUseAccountDataReturn,\n\tIUseChangePasswordReturn,\n\tIUseMfaLoginReturn,\n\tIUseMfaSetupReturn,\n\tIUseProfileReturn,\n} from './composables';\nexport {\n\tuseAccountData,\n\tuseChangePassword,\n\tuseForgotPassword,\n\tuseLogin,\n\tuseLogout,\n\tuseMfaLogin,\n\tuseMfaSetup,\n\tuseProfile,\n\tuseRegister,\n\tuseResetPassword,\n\tuseSession,\n\tuseVerifyEmail,\n} from './composables';\n\n// Token persistence primitives — for wiring app-level flows (e.g. the\n// client's auth.onTokensChanged) to the same storage the hooks use.\nexport { clearToken, persistToken, readToken, TOKEN_KEY } from './storage';\n","import type { AuthClient } from '@fonderie/client';\nimport { FonderieApiError } from '@fonderie/client';\nimport { useFonderieSubClient } from '@fonderie/vue';\nimport type { Ref } from 'vue';\nimport { ref } from 'vue';\nimport { clearToken } from '../storage';\n\nexport interface IUseAccountDataReturn {\n\t// GET /users/export — the caller's own data as a portable bundle (SAR).\n\texportData: () => Promise<unknown>;\n\t// Deletes the account, then tears the session down like a logout.\n\tdeleteUser: () => Promise<void>;\n\tisLoading: Ref<boolean>;\n\terror: Ref<FonderieApiError | null>;\n}\n\nexport function useAccountData(client?: AuthClient): IUseAccountDataReturn {\n\tconst auth = useFonderieSubClient(client, (c) => c.auth, 'useAccountData');\n\tconst isLoading = ref(false);\n\tconst error = ref<FonderieApiError | null>(null);\n\n\tasync function run<T>(op: () => Promise<T>): Promise<T> {\n\t\tisLoading.value = true;\n\t\terror.value = null;\n\t\ttry {\n\t\t\treturn await op();\n\t\t} catch (err) {\n\t\t\tconst apiError =\n\t\t\t\terr instanceof FonderieApiError ? err : new FonderieApiError('unknown', String(err), 0);\n\t\t\terror.value = apiError;\n\t\t\tthrow apiError;\n\t\t} finally {\n\t\t\tisLoading.value = false;\n\t\t}\n\t}\n\n\tfunction exportData() {\n\t\treturn run(async () => {\n\t\t\tconst { result } = await auth.exportData();\n\t\t\treturn result;\n\t\t});\n\t}\n\n\tfunction deleteUser() {\n\t\treturn run(async () => {\n\t\t\tawait auth.deleteUser();\n\t\t\tauth.setAccessToken(undefined);\n\t\t\tclearToken();\n\t\t});\n\t}\n\n\treturn { exportData, deleteUser, isLoading, error };\n}\n","export const TOKEN_KEY = 'fonderie_access_token';\n\nexport function persistToken(token: string) {\n\tlocalStorage.setItem(TOKEN_KEY, token);\n}\n\nexport function clearToken() {\n\tlocalStorage.removeItem(TOKEN_KEY);\n}\n\nexport function readToken(): string | null {\n\treturn localStorage.getItem(TOKEN_KEY);\n}\n","import type { AuthClient, IChangePasswordInput } from '@fonderie/client';\nimport { FonderieApiError } from '@fonderie/client';\nimport { useFonderieSubClient } from '@fonderie/vue';\nimport type { Ref } from 'vue';\nimport { ref } from 'vue';\n\nexport interface IUseChangePasswordReturn {\n\tchangePassword: (input: IChangePasswordInput) => Promise<void>;\n\tisLoading: Ref<boolean>;\n\terror: Ref<FonderieApiError | null>;\n\tdone: Ref<boolean>;\n}\n\nexport function useChangePassword(client?: AuthClient): IUseChangePasswordReturn {\n\tconst auth = useFonderieSubClient(client, (c) => c.auth, 'useChangePassword');\n\tconst isLoading = ref(false);\n\tconst error = ref<FonderieApiError | null>(null);\n\tconst done = ref(false);\n\n\tasync function changePassword(input: IChangePasswordInput) {\n\t\tisLoading.value = true;\n\t\terror.value = null;\n\t\tdone.value = false;\n\t\ttry {\n\t\t\tawait auth.changePassword(input);\n\t\t\tdone.value = true;\n\t\t} catch (err) {\n\t\t\tconst apiError =\n\t\t\t\terr instanceof FonderieApiError ? err : new FonderieApiError('unknown', String(err), 0);\n\t\t\terror.value = apiError;\n\t\t\tthrow apiError;\n\t\t} finally {\n\t\t\tisLoading.value = false;\n\t\t}\n\t}\n\n\treturn { changePassword, isLoading, error, done };\n}\n","import type { AuthClient } from '@fonderie/client';\nimport { FonderieApiError } from '@fonderie/client';\nimport { useFonderieSubClient } from '@fonderie/vue';\nimport { ref } from 'vue';\n\nexport function useForgotPassword(client?: AuthClient) {\n\tconst auth = useFonderieSubClient(client, (c) => c.auth, 'useForgotPassword');\n\tconst isLoading = ref(false);\n\tconst error = ref<FonderieApiError | null>(null);\n\tconst sent = ref(false);\n\n\tasync function forgotPassword(email: string) {\n\t\tisLoading.value = true;\n\t\terror.value = null;\n\t\ttry {\n\t\t\tawait auth.forgotPassword(email);\n\t\t\tsent.value = true;\n\t\t} catch (err) {\n\t\t\tconst apiError =\n\t\t\t\terr instanceof FonderieApiError ? err : new FonderieApiError('unknown', String(err), 0);\n\t\t\terror.value = apiError;\n\t\t\tthrow apiError;\n\t\t} finally {\n\t\t\tisLoading.value = false;\n\t\t}\n\t}\n\n\treturn { forgotPassword, isLoading, error, sent };\n}\n","import type { AuthClient, ILoginInput, ILoginResult, IMfaRequiredResult } from '@fonderie/client';\nimport { FonderieApiError, isMfaRequired } from '@fonderie/client';\nimport { useFonderieSubClient } from '@fonderie/vue';\nimport { ref } from 'vue';\nimport { persistToken } from '../storage';\n\nexport function useLogin(client?: AuthClient) {\n\tconst auth = useFonderieSubClient(client, (c) => c.auth, 'useLogin');\n\tconst isLoading = ref(false);\n\tconst error = ref<FonderieApiError | null>(null);\n\tconst data = ref<ILoginResult | null>(null);\n\t// Set when the account requires MFA: complete the login with\n\t// client.auth.mfa.verifyLogin(mfaPending.value.mfaToken, code).\n\tconst mfaPending = ref<IMfaRequiredResult | null>(null);\n\n\tasync function login(input: ILoginInput) {\n\t\tisLoading.value = true;\n\t\terror.value = null;\n\t\tmfaPending.value = null;\n\t\ttry {\n\t\t\tconst { result } = await auth.login(input);\n\t\t\tif (isMfaRequired(result)) {\n\t\t\t\tmfaPending.value = result;\n\t\t\t\treturn result;\n\t\t\t}\n\t\t\tauth.setAccessToken(result.tokens.access);\n\t\t\tpersistToken(result.tokens.access);\n\t\t\tdata.value = result;\n\t\t\treturn result;\n\t\t} catch (err) {\n\t\t\tconst apiError =\n\t\t\t\terr instanceof FonderieApiError ? err : new FonderieApiError('unknown', String(err), 0);\n\t\t\terror.value = apiError;\n\t\t\tthrow apiError;\n\t\t} finally {\n\t\t\tisLoading.value = false;\n\t\t}\n\t}\n\n\treturn { login, isLoading, error, data, mfaPending };\n}\n","import type { AuthClient } from '@fonderie/client';\nimport { FonderieApiError } from '@fonderie/client';\nimport { useFonderieSubClient } from '@fonderie/vue';\nimport { ref } from 'vue';\nimport { clearToken } from '../storage';\n\nexport function useLogout(client?: AuthClient) {\n\tconst auth = useFonderieSubClient(client, (c) => c.auth, 'useLogout');\n\tconst isLoading = ref(false);\n\tconst error = ref<FonderieApiError | null>(null);\n\n\tasync function logout(refreshToken?: string) {\n\t\tisLoading.value = true;\n\t\terror.value = null;\n\t\ttry {\n\t\t\tawait auth.logout(refreshToken);\n\t\t} catch (err) {\n\t\t\tconst apiError =\n\t\t\t\terr instanceof FonderieApiError ? err : new FonderieApiError('unknown', String(err), 0);\n\t\t\terror.value = apiError;\n\t\t} finally {\n\t\t\tauth.setAccessToken(undefined);\n\t\t\tclearToken();\n\t\t\tisLoading.value = false;\n\t\t}\n\t}\n\n\treturn { logout, isLoading, error };\n}\n","import type { AuthClient, ILoginResult } from '@fonderie/client';\nimport { FonderieApiError } from '@fonderie/client';\nimport { useFonderieSubClient } from '@fonderie/vue';\nimport type { Ref } from 'vue';\nimport { ref } from 'vue';\nimport { persistToken } from '../storage';\n\nexport interface IUseMfaLoginReturn {\n\t// Completes a login that returned MFA_REQUIRED: verifies the TOTP code\n\t// against the temporary mfaToken from useLogin's mfaPending, then persists\n\t// the issued tokens exactly like a normal login.\n\tverifyLogin: (mfaToken: string, code: string) => Promise<ILoginResult>;\n\tisLoading: Ref<boolean>;\n\terror: Ref<FonderieApiError | null>;\n\tdata: Ref<ILoginResult | null>;\n}\n\nexport function useMfaLogin(client?: AuthClient): IUseMfaLoginReturn {\n\tconst auth = useFonderieSubClient(client, (c) => c.auth, 'useMfaLogin');\n\tconst isLoading = ref(false);\n\tconst error = ref<FonderieApiError | null>(null);\n\tconst data = ref<ILoginResult | null>(null);\n\n\tasync function verifyLogin(mfaToken: string, code: string) {\n\t\tisLoading.value = true;\n\t\terror.value = null;\n\t\ttry {\n\t\t\tconst { result } = await auth.mfa.verifyLogin(mfaToken, code);\n\t\t\tauth.setAccessToken(result.tokens.access);\n\t\t\tpersistToken(result.tokens.access);\n\t\t\tdata.value = result;\n\t\t\treturn result;\n\t\t} catch (err) {\n\t\t\tconst apiError =\n\t\t\t\terr instanceof FonderieApiError ? err : new FonderieApiError('unknown', String(err), 0);\n\t\t\terror.value = apiError;\n\t\t\tthrow apiError;\n\t\t} finally {\n\t\t\tisLoading.value = false;\n\t\t}\n\t}\n\n\treturn { verifyLogin, isLoading, error, data };\n}\n","import type { AuthClient, IMfaEnabledResult, IMfaSetupResult } from '@fonderie/client';\nimport { FonderieApiError } from '@fonderie/client';\nimport { useFonderieSubClient } from '@fonderie/vue';\nimport type { Ref } from 'vue';\nimport { ref } from 'vue';\nimport { persistToken } from '../storage';\n\nexport interface IUseMfaSetupReturn {\n\t// Step 1: request enrollment — returns a data-URI QR code to scan and the\n\t// one-time backup codes generated at setup.\n\tsetup: () => Promise<IMfaSetupResult>;\n\tsetupData: Ref<IMfaSetupResult | null>;\n\t// Step 2: verify the first TOTP code. The server rotates the session's\n\t// tokens on success — the composable persists them exactly like a login,\n\t// so the session stays valid after enrollment.\n\tverify: (code: string) => Promise<IMfaEnabledResult>;\n\tdisable: (code: string) => Promise<void>;\n\tregenerateBackupCodes: (code: string) => Promise<string[]>;\n\tisLoading: Ref<boolean>;\n\terror: Ref<FonderieApiError | null>;\n}\n\nexport function useMfaSetup(client?: AuthClient): IUseMfaSetupReturn {\n\tconst auth = useFonderieSubClient(client, (c) => c.auth, 'useMfaSetup');\n\tconst setupData = ref<IMfaSetupResult | null>(null);\n\tconst isLoading = ref(false);\n\tconst error = ref<FonderieApiError | null>(null);\n\n\tasync function run<T>(op: () => Promise<T>): Promise<T> {\n\t\tisLoading.value = true;\n\t\terror.value = null;\n\t\ttry {\n\t\t\treturn await op();\n\t\t} catch (err) {\n\t\t\tconst apiError =\n\t\t\t\terr instanceof FonderieApiError ? err : new FonderieApiError('unknown', String(err), 0);\n\t\t\terror.value = apiError;\n\t\t\tthrow apiError;\n\t\t} finally {\n\t\t\tisLoading.value = false;\n\t\t}\n\t}\n\n\tfunction setup() {\n\t\treturn run(async () => {\n\t\t\tconst { result } = await auth.mfa.setup();\n\t\t\tsetupData.value = result;\n\t\t\treturn result;\n\t\t});\n\t}\n\n\tfunction verify(code: string) {\n\t\treturn run(async () => {\n\t\t\tconst { result } = await auth.mfa.verify(code);\n\t\t\tauth.setAccessToken(result.tokens.access);\n\t\t\tpersistToken(result.tokens.access);\n\t\t\treturn result;\n\t\t});\n\t}\n\n\tfunction disable(code: string) {\n\t\treturn run(async () => {\n\t\t\tawait auth.mfa.disable(code);\n\t\t});\n\t}\n\n\tfunction regenerateBackupCodes(code: string) {\n\t\treturn run(async () => {\n\t\t\tconst { result } = await auth.mfa.regenerateBackupCodes(code);\n\t\t\treturn result.backupCodes;\n\t\t});\n\t}\n\n\treturn { setup, setupData, verify, disable, regenerateBackupCodes, isLoading, error };\n}\n","import type {\n\tAuthClient,\n\tIUpdatePreferencesInput,\n\tIUpdateProfileInput,\n\tIUserDTO,\n} from '@fonderie/client';\nimport { FonderieApiError } from '@fonderie/client';\nimport { useFonderieSubClient } from '@fonderie/vue';\nimport type { Ref } from 'vue';\nimport { ref } from 'vue';\n\nexport interface IUseProfileReturn {\n\tuser: Ref<IUserDTO | null>;\n\trefresh: (opts?: { force?: boolean }) => Promise<void>;\n\tupdateProfile: (input: IUpdateProfileInput) => Promise<IUserDTO>;\n\tupdatePreferences: (input: IUpdatePreferencesInput) => Promise<IUserDTO>;\n\t// Email/phone changes re-fetch the profile (their endpoints don't return it).\n\tupdateEmail: (email: string) => Promise<void>;\n\tupdatePhone: (phone: string) => Promise<void>;\n\tisLoading: Ref<boolean>;\n\terror: Ref<FonderieApiError | null>;\n}\n\nexport function useProfile(client?: AuthClient): IUseProfileReturn {\n\tconst auth = useFonderieSubClient(client, (c) => c.auth, 'useProfile');\n\tconst user = ref<IUserDTO | null>(null);\n\tconst isLoading = ref(true);\n\tconst error = ref<FonderieApiError | null>(null);\n\n\tasync function refresh(opts?: { force?: boolean }) {\n\t\tisLoading.value = true;\n\t\terror.value = null;\n\t\ttry {\n\t\t\tconst { result } = await auth.getUser({ bust: opts?.force });\n\t\t\tuser.value = result.user;\n\t\t} catch (err) {\n\t\t\tconst apiError =\n\t\t\t\terr instanceof FonderieApiError ? err : new FonderieApiError('unknown', String(err), 0);\n\t\t\terror.value = apiError;\n\t\t} finally {\n\t\t\tisLoading.value = false;\n\t\t}\n\t}\n\n\tasync function mutate<T>(op: () => Promise<T>): Promise<T> {\n\t\terror.value = null;\n\t\ttry {\n\t\t\treturn await op();\n\t\t} catch (err) {\n\t\t\tconst apiError =\n\t\t\t\terr instanceof FonderieApiError ? err : new FonderieApiError('unknown', String(err), 0);\n\t\t\terror.value = apiError;\n\t\t\tthrow apiError;\n\t\t}\n\t}\n\n\tfunction updateProfile(input: IUpdateProfileInput) {\n\t\treturn mutate(async () => {\n\t\t\tconst { result } = await auth.updateProfile(input);\n\t\t\tuser.value = result.user;\n\t\t\treturn result.user;\n\t\t});\n\t}\n\n\tfunction updatePreferences(input: IUpdatePreferencesInput) {\n\t\treturn mutate(async () => {\n\t\t\tconst { result } = await auth.updatePreferences(input);\n\t\t\tuser.value = result.user;\n\t\t\treturn result.user;\n\t\t});\n\t}\n\n\tfunction updateEmail(email: string) {\n\t\treturn mutate(async () => {\n\t\t\tawait auth.updateEmail(email);\n\t\t\tawait refresh();\n\t\t});\n\t}\n\n\tfunction updatePhone(phone: string) {\n\t\treturn mutate(async () => {\n\t\t\tawait auth.updatePhone(phone);\n\t\t\tawait refresh();\n\t\t});\n\t}\n\n\tvoid refresh();\n\n\treturn { user, refresh, updateProfile, updatePreferences, updateEmail, updatePhone, isLoading, error };\n}\n","import type { AuthClient, IRegisterInput, IRegisterResult } from '@fonderie/client';\nimport { FonderieApiError } from '@fonderie/client';\nimport { useFonderieSubClient } from '@fonderie/vue';\nimport { ref } from 'vue';\nimport { persistToken } from '../storage';\n\nexport function useRegister(client?: AuthClient) {\n\tconst auth = useFonderieSubClient(client, (c) => c.auth, 'useRegister');\n\tconst isLoading = ref(false);\n\tconst error = ref<FonderieApiError | null>(null);\n\tconst data = ref<IRegisterResult | null>(null);\n\n\tasync function register(input: IRegisterInput) {\n\t\tisLoading.value = true;\n\t\terror.value = null;\n\t\ttry {\n\t\t\tconst { result } = await auth.register(input);\n\t\t\tauth.setAccessToken(result.tokens.access);\n\t\t\tpersistToken(result.tokens.access);\n\t\t\tdata.value = result;\n\t\t\treturn result;\n\t\t} catch (err) {\n\t\t\tconst apiError =\n\t\t\t\terr instanceof FonderieApiError ? err : new FonderieApiError('unknown', String(err), 0);\n\t\t\terror.value = apiError;\n\t\t\tthrow apiError;\n\t\t} finally {\n\t\t\tisLoading.value = false;\n\t\t}\n\t}\n\n\treturn { register, isLoading, error, data };\n}\n","import type { AuthClient, IResetPasswordInput } from '@fonderie/client';\nimport { FonderieApiError } from '@fonderie/client';\nimport { useFonderieSubClient } from '@fonderie/vue';\nimport { ref } from 'vue';\n\nexport function useResetPassword(client?: AuthClient) {\n\tconst auth = useFonderieSubClient(client, (c) => c.auth, 'useResetPassword');\n\tconst isLoading = ref(false);\n\tconst error = ref<FonderieApiError | null>(null);\n\tconst done = ref(false);\n\n\tasync function resetPassword(input: IResetPasswordInput) {\n\t\tisLoading.value = true;\n\t\terror.value = null;\n\t\ttry {\n\t\t\tawait auth.resetPassword(input);\n\t\t\tdone.value = true;\n\t\t} catch (err) {\n\t\t\tconst apiError =\n\t\t\t\terr instanceof FonderieApiError ? err : new FonderieApiError('unknown', String(err), 0);\n\t\t\terror.value = apiError;\n\t\t\tthrow apiError;\n\t\t} finally {\n\t\t\tisLoading.value = false;\n\t\t}\n\t}\n\n\treturn { resetPassword, isLoading, error, done };\n}\n","import type { AuthClient, IUserDTO } from '@fonderie/client';\nimport { useFonderieSubClient } from '@fonderie/vue';\nimport { ref } from 'vue';\nimport { clearToken, readToken } from '../storage';\n\nexport function useSession(client?: AuthClient) {\n\tconst auth = useFonderieSubClient(client, (c) => c.auth, 'useSession');\n\tconst user = ref<IUserDTO | null>(null);\n\tconst isLoading = ref(true);\n\tconst isAuthenticated = ref(false);\n\n\tasync function refresh(opts?: { force?: boolean }) {\n\t\tisLoading.value = true;\n\t\ttry {\n\t\t\tconst { result } = await auth.getUser({ bust: opts?.force });\n\t\t\tuser.value = result.user;\n\t\t\tisAuthenticated.value = true;\n\t\t} catch {\n\t\t\tuser.value = null;\n\t\t\tisAuthenticated.value = false;\n\t\t\tauth.setAccessToken(undefined);\n\t\t\tclearToken();\n\t\t} finally {\n\t\t\tisLoading.value = false;\n\t\t}\n\t}\n\n\tasync function logout(refreshToken?: string) {\n\t\ttry {\n\t\t\tawait auth.logout(refreshToken);\n\t\t} catch {\n\t\t\t// Session is being torn down regardless of server response.\n\t\t}\n\t\tauth.setAccessToken(undefined);\n\t\tclearToken();\n\t\tuser.value = null;\n\t\tisAuthenticated.value = false;\n\t}\n\n\tconst token = readToken();\n\tif (token) auth.setAccessToken(token);\n\tvoid refresh();\n\n\treturn { user, isLoading, isAuthenticated, refresh, logout };\n}\n","import type { AuthClient, IVerifyEmailResult } from '@fonderie/client';\nimport { FonderieApiError } from '@fonderie/client';\nimport { useFonderieSubClient } from '@fonderie/vue';\nimport { ref } from 'vue';\n\nexport function useVerifyEmail(client?: AuthClient) {\n\tconst auth = useFonderieSubClient(client, (c) => c.auth, 'useVerifyEmail');\n\tconst isLoading = ref(false);\n\tconst error = ref<FonderieApiError | null>(null);\n\tconst data = ref<IVerifyEmailResult | null>(null);\n\tconst resent = ref(false);\n\n\t// Re-sends the verification email — the other half of the same lifecycle,\n\t// so one composable owns both and screens don't split loading/error handling.\n\tasync function resend() {\n\t\tisLoading.value = true;\n\t\terror.value = null;\n\t\tresent.value = false;\n\t\ttry {\n\t\t\tawait auth.sendVerificationEmail();\n\t\t\tresent.value = true;\n\t\t} catch (err) {\n\t\t\tconst apiError =\n\t\t\t\terr instanceof FonderieApiError ? err : new FonderieApiError('unknown', String(err), 0);\n\t\t\terror.value = apiError;\n\t\t\tthrow apiError;\n\t\t} finally {\n\t\t\tisLoading.value = false;\n\t\t}\n\t}\n\n\tasync function verifyEmail(pin: string) {\n\t\tisLoading.value = true;\n\t\terror.value = null;\n\t\ttry {\n\t\t\tconst { result } = await auth.verifyEmail(pin);\n\t\t\tdata.value = result;\n\t\t\treturn result;\n\t\t} catch (err) {\n\t\t\tconst apiError =\n\t\t\t\terr instanceof FonderieApiError ? err : new FonderieApiError('unknown', String(err), 0);\n\t\t\terror.value = apiError;\n\t\t\tthrow apiError;\n\t\t} finally {\n\t\t\tisLoading.value = false;\n\t\t}\n\t}\n\n\treturn { verifyEmail, resend, resent, isLoading, error, data };\n}\n"],"mappings":";AAkBA,SAAS,oBAAAA,oBAAkB,iBAAAC,sBAAqB;;;ACjBhD,SAAS,wBAAwB;AACjC,SAAS,4BAA4B;AAErC,SAAS,WAAW;;;ACJb,IAAM,YAAY;AAElB,SAAS,aAAa,OAAe;AAC3C,eAAa,QAAQ,WAAW,KAAK;AACtC;AAEO,SAAS,aAAa;AAC5B,eAAa,WAAW,SAAS;AAClC;AAEO,SAAS,YAA2B;AAC1C,SAAO,aAAa,QAAQ,SAAS;AACtC;;;ADIO,SAAS,eAAe,QAA4C;AAC1E,QAAM,OAAO,qBAAqB,QAAQ,CAAC,MAAM,EAAE,MAAM,gBAAgB;AACzE,QAAM,YAAY,IAAI,KAAK;AAC3B,QAAM,QAAQ,IAA6B,IAAI;AAE/C,iBAAe,IAAO,IAAkC;AACvD,cAAU,QAAQ;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BAAiB,WAAW,OAAO,GAAG,GAAG,CAAC;AACvF,YAAM,QAAQ;AACd,YAAM;AAAA,IACP,UAAE;AACD,gBAAU,QAAQ;AAAA,IACnB;AAAA,EACD;AAEA,iBAAe,YAAY,KAAa;AACvC,cAAU,QAAQ;AAClB,UAAM,QAAQ;AACd,QAAI;AACH,YAAM,EAAE,OAAO,IAAI,MAAM,KAAK,YAAY,GAAG;AAC7C,WAAK,QAAQ;AACb,aAAO;AAAA,IACR,SAAS,KAAK;AACb,YAAM,WACL,eAAeA,qBAAmB,MAAM,IAAIA,mBAAiB,WAAW,OAAO,GAAG,GAAG,CAAC;AACvF,YAAM,QAAQ;AACd,YAAM;AAAA,IACP,UAAE;AACD,gBAAU,QAAQ;AAAA,IACnB;AAAA,EACD;AAEA,SAAO,EAAE,aAAa,QAAQ,QAAQ,WAAW,OAAO,KAAK;AAC9D;","names":["FonderieApiError","isMfaRequired","FonderieApiError","useFonderieSubClient","ref","FonderieApiError","useFonderieSubClient","ref","FonderieApiError","useFonderieSubClient","ref","useFonderieSubClient","ref","FonderieApiError","FonderieApiError","useFonderieSubClient","ref","useFonderieSubClient","ref","FonderieApiError","FonderieApiError","useFonderieSubClient","ref","useFonderieSubClient","ref","FonderieApiError","FonderieApiError","useFonderieSubClient","ref","useFonderieSubClient","ref","FonderieApiError","FonderieApiError","useFonderieSubClient","ref","FonderieApiError","useFonderieSubClient","ref","useFonderieSubClient","ref","FonderieApiError","FonderieApiError","useFonderieSubClient","ref","useFonderieSubClient","ref","useFonderieSubClient","ref","FonderieApiError","useFonderieSubClient","ref"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/composables/useAccountData.ts","../src/storage.ts","../src/composables/useChangePassword.ts","../src/composables/useForgotPassword.ts","../src/composables/useLogin.ts","../src/composables/useLogout.ts","../src/composables/useMfaLogin.ts","../src/composables/useMfaSetup.ts","../src/composables/useProfile.ts","../src/composables/useRegister.ts","../src/composables/useResetPassword.ts","../src/composables/useSession.ts","../src/composables/useVerifyEmail.ts"],"sourcesContent":["export type {\n\tAuthClient,\n\tIChangePasswordInput,\n\tILoginInput,\n\tILoginResult,\n\tIMfaEnabledResult,\n\tIMfaRequiredResult,\n\tIMfaSetupResult,\n\tIRegisterInput,\n\tIRegisterResult,\n\tIResetPasswordInput,\n\tITokens,\n\tIUpdatePreferencesInput,\n\tIUpdateProfileInput,\n\tIUserDTO,\n\tIVerifyEmailResult,\n} from '@fonderie/client';\n\nexport { FonderieApiError, isMfaRequired } from '@fonderie/client';\n\nexport type {\n\tIUseAccountDataReturn,\n\tIUseChangePasswordReturn,\n\tIUseForgotPasswordReturn,\n\tIUseLoginReturn,\n\tIUseLogoutReturn,\n\tIUseMfaLoginReturn,\n\tIUseMfaSetupReturn,\n\tIUseProfileReturn,\n\tIUseRegisterReturn,\n\tIUseResetPasswordReturn,\n\tIUseSessionReturn,\n\tIUseVerifyEmailReturn,\n} from './composables';\nexport {\n\tuseAccountData,\n\tuseChangePassword,\n\tuseForgotPassword,\n\tuseLogin,\n\tuseLogout,\n\tuseMfaLogin,\n\tuseMfaSetup,\n\tuseProfile,\n\tuseRegister,\n\tuseResetPassword,\n\tuseSession,\n\tuseVerifyEmail,\n} from './composables';\n\n// Token persistence primitives — for wiring app-level flows (e.g. the\n// client's auth.onTokensChanged) to the same storage the hooks use.\nexport { clearToken, persistToken, readToken, TOKEN_KEY } from './storage';\n","import type { AuthClient } from '@fonderie/client';\nimport { FonderieApiError } from '@fonderie/client';\nimport { useFonderieSubClient } from '@fonderie/vue';\nimport type { Ref } from 'vue';\nimport { ref } from 'vue';\nimport { clearToken } from '../storage';\n\nexport interface IUseAccountDataReturn {\n\t// GET /users/export — the caller's own data as a portable bundle (SAR).\n\texportData: () => Promise<unknown>;\n\t// Deletes the account, then tears the session down like a logout.\n\tdeleteUser: () => Promise<void>;\n\tisLoading: Ref<boolean>;\n\terror: Ref<FonderieApiError | null>;\n}\n\nexport function useAccountData(client?: AuthClient): IUseAccountDataReturn {\n\tconst auth = useFonderieSubClient(client, (c) => c.auth, 'useAccountData');\n\tconst isLoading = ref(false);\n\tconst error = ref<FonderieApiError | null>(null);\n\n\tasync function run<T>(op: () => Promise<T>): Promise<T> {\n\t\tisLoading.value = true;\n\t\terror.value = null;\n\t\ttry {\n\t\t\treturn await op();\n\t\t} catch (err) {\n\t\t\tconst apiError =\n\t\t\t\terr instanceof FonderieApiError ? err : new FonderieApiError('unknown', String(err), 0);\n\t\t\terror.value = apiError;\n\t\t\tthrow apiError;\n\t\t} finally {\n\t\t\tisLoading.value = false;\n\t\t}\n\t}\n\n\tfunction exportData() {\n\t\treturn run(async () => {\n\t\t\tconst { result } = await auth.exportData();\n\t\t\treturn result;\n\t\t});\n\t}\n\n\tfunction deleteUser() {\n\t\treturn run(async () => {\n\t\t\tawait auth.deleteUser();\n\t\t\tauth.setAccessToken(undefined);\n\t\t\tclearToken();\n\t\t});\n\t}\n\n\treturn { exportData, deleteUser, isLoading, error };\n}\n","export const TOKEN_KEY = 'fonderie_access_token';\n\nexport function persistToken(token: string) {\n\tlocalStorage.setItem(TOKEN_KEY, token);\n}\n\nexport function clearToken() {\n\tlocalStorage.removeItem(TOKEN_KEY);\n}\n\nexport function readToken(): string | null {\n\treturn localStorage.getItem(TOKEN_KEY);\n}\n","import type { AuthClient, IChangePasswordInput } from '@fonderie/client';\nimport { FonderieApiError } from '@fonderie/client';\nimport { useFonderieSubClient } from '@fonderie/vue';\nimport type { Ref } from 'vue';\nimport { ref } from 'vue';\n\nexport interface IUseChangePasswordReturn {\n\tchangePassword: (input: IChangePasswordInput) => Promise<void>;\n\tisLoading: Ref<boolean>;\n\terror: Ref<FonderieApiError | null>;\n\tdone: Ref<boolean>;\n}\n\nexport function useChangePassword(client?: AuthClient): IUseChangePasswordReturn {\n\tconst auth = useFonderieSubClient(client, (c) => c.auth, 'useChangePassword');\n\tconst isLoading = ref(false);\n\tconst error = ref<FonderieApiError | null>(null);\n\tconst done = ref(false);\n\n\tasync function changePassword(input: IChangePasswordInput) {\n\t\tisLoading.value = true;\n\t\terror.value = null;\n\t\tdone.value = false;\n\t\ttry {\n\t\t\tawait auth.changePassword(input);\n\t\t\tdone.value = true;\n\t\t} catch (err) {\n\t\t\tconst apiError =\n\t\t\t\terr instanceof FonderieApiError ? err : new FonderieApiError('unknown', String(err), 0);\n\t\t\terror.value = apiError;\n\t\t\tthrow apiError;\n\t\t} finally {\n\t\t\tisLoading.value = false;\n\t\t}\n\t}\n\n\treturn { changePassword, isLoading, error, done };\n}\n","import type { AuthClient } from '@fonderie/client';\nimport { FonderieApiError } from '@fonderie/client';\nimport { useFonderieSubClient } from '@fonderie/vue';\nimport type { Ref } from 'vue';\nimport { ref } from 'vue';\n\nexport interface IUseForgotPasswordReturn {\n\tforgotPassword: (email: string) => Promise<void>;\n\tisLoading: Ref<boolean>;\n\terror: Ref<FonderieApiError | null>;\n\tsent: Ref<boolean>;\n}\n\nexport function useForgotPassword(client?: AuthClient): IUseForgotPasswordReturn {\n\tconst auth = useFonderieSubClient(client, (c) => c.auth, 'useForgotPassword');\n\tconst isLoading = ref(false);\n\tconst error = ref<FonderieApiError | null>(null);\n\tconst sent = ref(false);\n\n\tasync function forgotPassword(email: string) {\n\t\tisLoading.value = true;\n\t\terror.value = null;\n\t\ttry {\n\t\t\tawait auth.forgotPassword(email);\n\t\t\tsent.value = true;\n\t\t} catch (err) {\n\t\t\tconst apiError =\n\t\t\t\terr instanceof FonderieApiError ? err : new FonderieApiError('unknown', String(err), 0);\n\t\t\terror.value = apiError;\n\t\t\tthrow apiError;\n\t\t} finally {\n\t\t\tisLoading.value = false;\n\t\t}\n\t}\n\n\treturn { forgotPassword, isLoading, error, sent };\n}\n","import type { AuthClient, ILoginInput, ILoginResult, IMfaRequiredResult } from '@fonderie/client';\nimport { FonderieApiError, isMfaRequired } from '@fonderie/client';\nimport { useFonderieSubClient } from '@fonderie/vue';\nimport type { Ref } from 'vue';\nimport { ref } from 'vue';\nimport { persistToken } from '../storage';\n\nexport interface IUseLoginReturn {\n\tlogin: (input: ILoginInput) => Promise<ILoginResult | IMfaRequiredResult>;\n\tisLoading: Ref<boolean>;\n\terror: Ref<FonderieApiError | null>;\n\tdata: Ref<ILoginResult | null>;\n\t// Set when the account requires MFA: no tokens were issued — complete the\n\t// login with client.auth.mfa.verifyLogin(mfaPending.value.mfaToken, code).\n\tmfaPending: Ref<IMfaRequiredResult | null>;\n}\n\nexport function useLogin(client?: AuthClient): IUseLoginReturn {\n\tconst auth = useFonderieSubClient(client, (c) => c.auth, 'useLogin');\n\tconst isLoading = ref(false);\n\tconst error = ref<FonderieApiError | null>(null);\n\tconst data = ref<ILoginResult | null>(null);\n\t// Set when the account requires MFA: complete the login with\n\t// client.auth.mfa.verifyLogin(mfaPending.value.mfaToken, code).\n\tconst mfaPending = ref<IMfaRequiredResult | null>(null);\n\n\tasync function login(input: ILoginInput) {\n\t\tisLoading.value = true;\n\t\terror.value = null;\n\t\tmfaPending.value = null;\n\t\ttry {\n\t\t\tconst { result } = await auth.login(input);\n\t\t\tif (isMfaRequired(result)) {\n\t\t\t\tmfaPending.value = result;\n\t\t\t\treturn result;\n\t\t\t}\n\t\t\tauth.setAccessToken(result.tokens.access);\n\t\t\tpersistToken(result.tokens.access);\n\t\t\tdata.value = result;\n\t\t\treturn result;\n\t\t} catch (err) {\n\t\t\tconst apiError =\n\t\t\t\terr instanceof FonderieApiError ? err : new FonderieApiError('unknown', String(err), 0);\n\t\t\terror.value = apiError;\n\t\t\tthrow apiError;\n\t\t} finally {\n\t\t\tisLoading.value = false;\n\t\t}\n\t}\n\n\treturn { login, isLoading, error, data, mfaPending };\n}\n","import type { AuthClient } from '@fonderie/client';\nimport { FonderieApiError } from '@fonderie/client';\nimport { useFonderieSubClient } from '@fonderie/vue';\nimport type { Ref } from 'vue';\nimport { ref } from 'vue';\nimport { clearToken } from '../storage';\n\nexport interface IUseLogoutReturn {\n\tlogout: (refreshToken?: string) => Promise<void>;\n\tisLoading: Ref<boolean>;\n\terror: Ref<FonderieApiError | null>;\n}\n\nexport function useLogout(client?: AuthClient): IUseLogoutReturn {\n\tconst auth = useFonderieSubClient(client, (c) => c.auth, 'useLogout');\n\tconst isLoading = ref(false);\n\tconst error = ref<FonderieApiError | null>(null);\n\n\tasync function logout(refreshToken?: string) {\n\t\tisLoading.value = true;\n\t\terror.value = null;\n\t\ttry {\n\t\t\tawait auth.logout(refreshToken);\n\t\t} catch (err) {\n\t\t\tconst apiError =\n\t\t\t\terr instanceof FonderieApiError ? err : new FonderieApiError('unknown', String(err), 0);\n\t\t\terror.value = apiError;\n\t\t} finally {\n\t\t\tauth.setAccessToken(undefined);\n\t\t\tclearToken();\n\t\t\tisLoading.value = false;\n\t\t}\n\t}\n\n\treturn { logout, isLoading, error };\n}\n","import type { AuthClient, ILoginResult } from '@fonderie/client';\nimport { FonderieApiError } from '@fonderie/client';\nimport { useFonderieSubClient } from '@fonderie/vue';\nimport type { Ref } from 'vue';\nimport { ref } from 'vue';\nimport { persistToken } from '../storage';\n\nexport interface IUseMfaLoginReturn {\n\t// Completes a login that returned MFA_REQUIRED: verifies the TOTP code\n\t// against the temporary mfaToken from useLogin's mfaPending, then persists\n\t// the issued tokens exactly like a normal login.\n\tverifyLogin: (mfaToken: string, code: string) => Promise<ILoginResult>;\n\tisLoading: Ref<boolean>;\n\terror: Ref<FonderieApiError | null>;\n\tdata: Ref<ILoginResult | null>;\n}\n\nexport function useMfaLogin(client?: AuthClient): IUseMfaLoginReturn {\n\tconst auth = useFonderieSubClient(client, (c) => c.auth, 'useMfaLogin');\n\tconst isLoading = ref(false);\n\tconst error = ref<FonderieApiError | null>(null);\n\tconst data = ref<ILoginResult | null>(null);\n\n\tasync function verifyLogin(mfaToken: string, code: string) {\n\t\tisLoading.value = true;\n\t\terror.value = null;\n\t\ttry {\n\t\t\tconst { result } = await auth.mfa.verifyLogin(mfaToken, code);\n\t\t\tauth.setAccessToken(result.tokens.access);\n\t\t\tpersistToken(result.tokens.access);\n\t\t\tdata.value = result;\n\t\t\treturn result;\n\t\t} catch (err) {\n\t\t\tconst apiError =\n\t\t\t\terr instanceof FonderieApiError ? err : new FonderieApiError('unknown', String(err), 0);\n\t\t\terror.value = apiError;\n\t\t\tthrow apiError;\n\t\t} finally {\n\t\t\tisLoading.value = false;\n\t\t}\n\t}\n\n\treturn { verifyLogin, isLoading, error, data };\n}\n","import type { AuthClient, IMfaEnabledResult, IMfaSetupResult } from '@fonderie/client';\nimport { FonderieApiError } from '@fonderie/client';\nimport { useFonderieSubClient } from '@fonderie/vue';\nimport type { Ref } from 'vue';\nimport { ref } from 'vue';\nimport { persistToken } from '../storage';\n\nexport interface IUseMfaSetupReturn {\n\t// Step 1: request enrollment — returns a data-URI QR code to scan and the\n\t// one-time backup codes generated at setup.\n\tsetup: () => Promise<IMfaSetupResult>;\n\tsetupData: Ref<IMfaSetupResult | null>;\n\t// Step 2: verify the first TOTP code. The server rotates the session's\n\t// tokens on success — the composable persists them exactly like a login,\n\t// so the session stays valid after enrollment.\n\tverify: (code: string) => Promise<IMfaEnabledResult>;\n\tdisable: (code: string) => Promise<void>;\n\tregenerateBackupCodes: (code: string) => Promise<string[]>;\n\tisLoading: Ref<boolean>;\n\terror: Ref<FonderieApiError | null>;\n}\n\nexport function useMfaSetup(client?: AuthClient): IUseMfaSetupReturn {\n\tconst auth = useFonderieSubClient(client, (c) => c.auth, 'useMfaSetup');\n\tconst setupData = ref<IMfaSetupResult | null>(null);\n\tconst isLoading = ref(false);\n\tconst error = ref<FonderieApiError | null>(null);\n\n\tasync function run<T>(op: () => Promise<T>): Promise<T> {\n\t\tisLoading.value = true;\n\t\terror.value = null;\n\t\ttry {\n\t\t\treturn await op();\n\t\t} catch (err) {\n\t\t\tconst apiError =\n\t\t\t\terr instanceof FonderieApiError ? err : new FonderieApiError('unknown', String(err), 0);\n\t\t\terror.value = apiError;\n\t\t\tthrow apiError;\n\t\t} finally {\n\t\t\tisLoading.value = false;\n\t\t}\n\t}\n\n\tfunction setup() {\n\t\treturn run(async () => {\n\t\t\tconst { result } = await auth.mfa.setup();\n\t\t\tsetupData.value = result;\n\t\t\treturn result;\n\t\t});\n\t}\n\n\tfunction verify(code: string) {\n\t\treturn run(async () => {\n\t\t\tconst { result } = await auth.mfa.verify(code);\n\t\t\tauth.setAccessToken(result.tokens.access);\n\t\t\tpersistToken(result.tokens.access);\n\t\t\treturn result;\n\t\t});\n\t}\n\n\tfunction disable(code: string) {\n\t\treturn run(async () => {\n\t\t\tawait auth.mfa.disable(code);\n\t\t});\n\t}\n\n\tfunction regenerateBackupCodes(code: string) {\n\t\treturn run(async () => {\n\t\t\tconst { result } = await auth.mfa.regenerateBackupCodes(code);\n\t\t\treturn result.backupCodes;\n\t\t});\n\t}\n\n\treturn { setup, setupData, verify, disable, regenerateBackupCodes, isLoading, error };\n}\n","import type {\n\tAuthClient,\n\tIUpdatePreferencesInput,\n\tIUpdateProfileInput,\n\tIUserDTO,\n} from '@fonderie/client';\nimport { FonderieApiError } from '@fonderie/client';\nimport { useFonderieSubClient } from '@fonderie/vue';\nimport type { Ref } from 'vue';\nimport { onMounted, ref } from 'vue';\n\nexport interface IUseProfileReturn {\n\tuser: Ref<IUserDTO | null>;\n\trefresh: (opts?: { force?: boolean }) => Promise<void>;\n\tupdateProfile: (input: IUpdateProfileInput) => Promise<IUserDTO>;\n\tupdatePreferences: (input: IUpdatePreferencesInput) => Promise<IUserDTO>;\n\t// Email/phone changes re-fetch the profile (their endpoints don't return it).\n\tupdateEmail: (email: string) => Promise<void>;\n\tupdatePhone: (phone: string) => Promise<void>;\n\tisLoading: Ref<boolean>;\n\terror: Ref<FonderieApiError | null>;\n}\n\nexport function useProfile(client?: AuthClient): IUseProfileReturn {\n\tconst auth = useFonderieSubClient(client, (c) => c.auth, 'useProfile');\n\tconst user = ref<IUserDTO | null>(null);\n\tconst isLoading = ref(true);\n\tconst error = ref<FonderieApiError | null>(null);\n\n\tasync function refresh(opts?: { force?: boolean }) {\n\t\tisLoading.value = true;\n\t\terror.value = null;\n\t\ttry {\n\t\t\tconst { result } = await auth.getUser({ bust: opts?.force });\n\t\t\tuser.value = result.user;\n\t\t} catch (err) {\n\t\t\tconst apiError =\n\t\t\t\terr instanceof FonderieApiError ? err : new FonderieApiError('unknown', String(err), 0);\n\t\t\terror.value = apiError;\n\t\t} finally {\n\t\t\tisLoading.value = false;\n\t\t}\n\t}\n\n\tasync function mutate<T>(op: () => Promise<T>): Promise<T> {\n\t\terror.value = null;\n\t\ttry {\n\t\t\treturn await op();\n\t\t} catch (err) {\n\t\t\tconst apiError =\n\t\t\t\terr instanceof FonderieApiError ? err : new FonderieApiError('unknown', String(err), 0);\n\t\t\terror.value = apiError;\n\t\t\tthrow apiError;\n\t\t}\n\t}\n\n\tfunction updateProfile(input: IUpdateProfileInput) {\n\t\treturn mutate(async () => {\n\t\t\tconst { result } = await auth.updateProfile(input);\n\t\t\tuser.value = result.user;\n\t\t\treturn result.user;\n\t\t});\n\t}\n\n\tfunction updatePreferences(input: IUpdatePreferencesInput) {\n\t\treturn mutate(async () => {\n\t\t\tconst { result } = await auth.updatePreferences(input);\n\t\t\tuser.value = result.user;\n\t\t\treturn result.user;\n\t\t});\n\t}\n\n\tfunction updateEmail(email: string) {\n\t\treturn mutate(async () => {\n\t\t\tawait auth.updateEmail(email);\n\t\t\tawait refresh();\n\t\t});\n\t}\n\n\tfunction updatePhone(phone: string) {\n\t\treturn mutate(async () => {\n\t\t\tawait auth.updatePhone(phone);\n\t\t\tawait refresh();\n\t\t});\n\t}\n\n\tonMounted(() => void refresh());\n\n\treturn { user, refresh, updateProfile, updatePreferences, updateEmail, updatePhone, isLoading, error };\n}\n","import type { AuthClient, IRegisterInput, IRegisterResult } from '@fonderie/client';\nimport { FonderieApiError } from '@fonderie/client';\nimport { useFonderieSubClient } from '@fonderie/vue';\nimport type { Ref } from 'vue';\nimport { ref } from 'vue';\nimport { persistToken } from '../storage';\n\nexport interface IUseRegisterReturn {\n\tregister: (input: IRegisterInput) => Promise<IRegisterResult>;\n\tisLoading: Ref<boolean>;\n\terror: Ref<FonderieApiError | null>;\n\tdata: Ref<IRegisterResult | null>;\n}\n\nexport function useRegister(client?: AuthClient): IUseRegisterReturn {\n\tconst auth = useFonderieSubClient(client, (c) => c.auth, 'useRegister');\n\tconst isLoading = ref(false);\n\tconst error = ref<FonderieApiError | null>(null);\n\tconst data = ref<IRegisterResult | null>(null);\n\n\tasync function register(input: IRegisterInput) {\n\t\tisLoading.value = true;\n\t\terror.value = null;\n\t\ttry {\n\t\t\tconst { result } = await auth.register(input);\n\t\t\tauth.setAccessToken(result.tokens.access);\n\t\t\tpersistToken(result.tokens.access);\n\t\t\tdata.value = result;\n\t\t\treturn result;\n\t\t} catch (err) {\n\t\t\tconst apiError =\n\t\t\t\terr instanceof FonderieApiError ? err : new FonderieApiError('unknown', String(err), 0);\n\t\t\terror.value = apiError;\n\t\t\tthrow apiError;\n\t\t} finally {\n\t\t\tisLoading.value = false;\n\t\t}\n\t}\n\n\treturn { register, isLoading, error, data };\n}\n","import type { AuthClient, IResetPasswordInput } from '@fonderie/client';\nimport { FonderieApiError } from '@fonderie/client';\nimport { useFonderieSubClient } from '@fonderie/vue';\nimport type { Ref } from 'vue';\nimport { ref } from 'vue';\n\nexport interface IUseResetPasswordReturn {\n\tresetPassword: (input: IResetPasswordInput) => Promise<void>;\n\tisLoading: Ref<boolean>;\n\terror: Ref<FonderieApiError | null>;\n\tdone: Ref<boolean>;\n}\n\nexport function useResetPassword(client?: AuthClient): IUseResetPasswordReturn {\n\tconst auth = useFonderieSubClient(client, (c) => c.auth, 'useResetPassword');\n\tconst isLoading = ref(false);\n\tconst error = ref<FonderieApiError | null>(null);\n\tconst done = ref(false);\n\n\tasync function resetPassword(input: IResetPasswordInput) {\n\t\tisLoading.value = true;\n\t\terror.value = null;\n\t\ttry {\n\t\t\tawait auth.resetPassword(input);\n\t\t\tdone.value = true;\n\t\t} catch (err) {\n\t\t\tconst apiError =\n\t\t\t\terr instanceof FonderieApiError ? err : new FonderieApiError('unknown', String(err), 0);\n\t\t\terror.value = apiError;\n\t\t\tthrow apiError;\n\t\t} finally {\n\t\t\tisLoading.value = false;\n\t\t}\n\t}\n\n\treturn { resetPassword, isLoading, error, done };\n}\n","import type { AuthClient, IUserDTO } from '@fonderie/client';\nimport { useFonderieSubClient } from '@fonderie/vue';\nimport type { Ref } from 'vue';\nimport { onMounted, ref } from 'vue';\nimport { clearToken, readToken } from '../storage';\n\nexport interface IUseSessionReturn {\n\tuser: Ref<IUserDTO | null>;\n\tisLoading: Ref<boolean>;\n\tisAuthenticated: Ref<boolean>;\n\trefresh: (opts?: { force?: boolean }) => Promise<void>;\n\tlogout: (refreshToken?: string) => Promise<void>;\n}\n\nexport function useSession(client?: AuthClient): IUseSessionReturn {\n\tconst auth = useFonderieSubClient(client, (c) => c.auth, 'useSession');\n\tconst user = ref<IUserDTO | null>(null);\n\tconst isLoading = ref(true);\n\tconst isAuthenticated = ref(false);\n\n\tasync function refresh(opts?: { force?: boolean }) {\n\t\tisLoading.value = true;\n\t\ttry {\n\t\t\tconst { result } = await auth.getUser({ bust: opts?.force });\n\t\t\tuser.value = result.user;\n\t\t\tisAuthenticated.value = true;\n\t\t} catch {\n\t\t\tuser.value = null;\n\t\t\tisAuthenticated.value = false;\n\t\t\tauth.setAccessToken(undefined);\n\t\t\tclearToken();\n\t\t} finally {\n\t\t\tisLoading.value = false;\n\t\t}\n\t}\n\n\tasync function logout(refreshToken?: string) {\n\t\ttry {\n\t\t\tawait auth.logout(refreshToken);\n\t\t} catch {\n\t\t\t// Session is being torn down regardless of server response.\n\t\t}\n\t\tauth.setAccessToken(undefined);\n\t\tclearToken();\n\t\tuser.value = null;\n\t\tisAuthenticated.value = false;\n\t}\n\n\tconst token = readToken();\n\tif (token) auth.setAccessToken(token);\n\tonMounted(() => void refresh());\n\n\treturn { user, isLoading, isAuthenticated, refresh, logout };\n}\n","import type { AuthClient, IVerifyEmailResult } from '@fonderie/client';\nimport { FonderieApiError } from '@fonderie/client';\nimport { useFonderieSubClient } from '@fonderie/vue';\nimport type { Ref } from 'vue';\nimport { ref } from 'vue';\n\nexport interface IUseVerifyEmailReturn {\n\tverifyEmail: (pin: string) => Promise<IVerifyEmailResult>;\n\tresend: () => Promise<void>;\n\tresent: Ref<boolean>;\n\tisLoading: Ref<boolean>;\n\terror: Ref<FonderieApiError | null>;\n\tdata: Ref<IVerifyEmailResult | null>;\n}\n\nexport function useVerifyEmail(client?: AuthClient): IUseVerifyEmailReturn {\n\tconst auth = useFonderieSubClient(client, (c) => c.auth, 'useVerifyEmail');\n\tconst isLoading = ref(false);\n\tconst error = ref<FonderieApiError | null>(null);\n\tconst data = ref<IVerifyEmailResult | null>(null);\n\tconst resent = ref(false);\n\n\t// Re-sends the verification email — the other half of the same lifecycle,\n\t// so one composable owns both and screens don't split loading/error handling.\n\tasync function resend() {\n\t\tisLoading.value = true;\n\t\terror.value = null;\n\t\tresent.value = false;\n\t\ttry {\n\t\t\tawait auth.sendVerificationEmail();\n\t\t\tresent.value = true;\n\t\t} catch (err) {\n\t\t\tconst apiError =\n\t\t\t\terr instanceof FonderieApiError ? err : new FonderieApiError('unknown', String(err), 0);\n\t\t\terror.value = apiError;\n\t\t\tthrow apiError;\n\t\t} finally {\n\t\t\tisLoading.value = false;\n\t\t}\n\t}\n\n\tasync function verifyEmail(pin: string) {\n\t\tisLoading.value = true;\n\t\terror.value = null;\n\t\ttry {\n\t\t\tconst { result } = await auth.verifyEmail(pin);\n\t\t\tdata.value = result;\n\t\t\treturn result;\n\t\t} catch (err) {\n\t\t\tconst apiError =\n\t\t\t\terr instanceof FonderieApiError ? err : new FonderieApiError('unknown', String(err), 0);\n\t\t\terror.value = apiError;\n\t\t\tthrow apiError;\n\t\t} finally {\n\t\t\tisLoading.value = false;\n\t\t}\n\t}\n\n\treturn { verifyEmail, resend, resent, isLoading, error, data };\n}\n"],"mappings":";AAkBA,SAAS,oBAAAA,oBAAkB,iBAAAC,sBAAqB;;;ACjBhD,SAAS,wBAAwB;AACjC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C,0BAAwB;AACjC,SAAS,wBAAAC,8BAA4B;AAErC,SAAS,OAAAC,aAAW;AAWb,SAAS,eAAe,QAA4C;AAC1E,QAAM,OAAOD,uBAAqB,QAAQ,CAAC,MAAM,EAAE,MAAM,gBAAgB;AACzE,QAAM,YAAYC,MAAI,KAAK;AAC3B,QAAM,QAAQA,MAA6B,IAAI;AAC/C,QAAM,OAAOA,MAA+B,IAAI;AAChD,QAAM,SAASA,MAAI,KAAK;AAIxB,iBAAe,SAAS;AACvB,cAAU,QAAQ;AAClB,UAAM,QAAQ;AACd,WAAO,QAAQ;AACf,QAAI;AACH,YAAM,KAAK,sBAAsB;AACjC,aAAO,QAAQ;AAAA,IAChB,SAAS,KAAK;AACb,YAAM,WACL,eAAeF,qBAAmB,MAAM,IAAIA,mBAAiB,WAAW,OAAO,GAAG,GAAG,CAAC;AACvF,YAAM,QAAQ;AACd,YAAM;AAAA,IACP,UAAE;AACD,gBAAU,QAAQ;AAAA,IACnB;AAAA,EACD;AAEA,iBAAe,YAAY,KAAa;AACvC,cAAU,QAAQ;AAClB,UAAM,QAAQ;AACd,QAAI;AACH,YAAM,EAAE,OAAO,IAAI,MAAM,KAAK,YAAY,GAAG;AAC7C,WAAK,QAAQ;AACb,aAAO;AAAA,IACR,SAAS,KAAK;AACb,YAAM,WACL,eAAeA,qBAAmB,MAAM,IAAIA,mBAAiB,WAAW,OAAO,GAAG,GAAG,CAAC;AACvF,YAAM,QAAQ;AACd,YAAM;AAAA,IACP,UAAE;AACD,gBAAU,QAAQ;AAAA,IACnB;AAAA,EACD;AAEA,SAAO,EAAE,aAAa,QAAQ,QAAQ,WAAW,OAAO,KAAK;AAC9D;","names":["FonderieApiError","isMfaRequired","FonderieApiError","useFonderieSubClient","ref","FonderieApiError","useFonderieSubClient","ref","FonderieApiError","useFonderieSubClient","ref","useFonderieSubClient","ref","FonderieApiError","FonderieApiError","useFonderieSubClient","ref","useFonderieSubClient","ref","FonderieApiError","FonderieApiError","useFonderieSubClient","ref","useFonderieSubClient","ref","FonderieApiError","FonderieApiError","useFonderieSubClient","ref","useFonderieSubClient","ref","FonderieApiError","FonderieApiError","useFonderieSubClient","ref","FonderieApiError","useFonderieSubClient","ref","useFonderieSubClient","ref","FonderieApiError","FonderieApiError","useFonderieSubClient","ref","useFonderieSubClient","onMounted","ref","useFonderieSubClient","ref","onMounted","FonderieApiError","useFonderieSubClient","ref"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fonderie/vue-auth",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Vue composables for Fonderie auth
|
|
3
|
+
"version": "0.8.0",
|
|
4
|
+
"description": "Vue composables for Fonderie auth \u2014 thin bindings over @fonderie/client.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"fonderiejs",
|
|
7
7
|
"vue",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@fonderie/vue": "*"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
|
-
"vue": ">=3.
|
|
41
|
+
"vue": ">=3.3.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@types/node": "^26.2.0",
|