@fonderie/vue-auth 0.6.0 → 0.6.1

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.
@@ -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 a TOTP secret + otpauth URI to show as a QR code.\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: () => 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() {\n\t\tisLoading.value = true;\n\t\terror.value = null;\n\t\ttry {\n\t\t\tconst { result } = await auth.getUser();\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() {\n\t\tisLoading.value = true;\n\t\ttry {\n\t\t\tconst { result } = await auth.getUser();\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;AA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AM,WAAO,kBAA+B,IAAI;AAChD,QAAM,aAAS,kBAAI,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,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,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"]}
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: () => 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() {\n\t\tisLoading.value = true;\n\t\terror.value = null;\n\t\ttry {\n\t\t\tconst { result } = await auth.getUser();\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() {\n\t\tisLoading.value = true;\n\t\ttry {\n\t\t\tconst { result } = await auth.getUser();\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,iC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C,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.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 a TOTP secret + otpauth URI to show as a QR code.\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: () => 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() {\n\t\tisLoading.value = true;\n\t\terror.value = null;\n\t\ttry {\n\t\t\tconst { result } = await auth.getUser();\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() {\n\t\tisLoading.value = true;\n\t\ttry {\n\t\t\tconst { result } = await auth.getUser();\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;AAClB,UAAM,QAAQ;AACd,QAAI;AACH,aAAO,MAAM,GAAG;AAAA,IACjB,SAAS,KAAK;AACb,YAAM,WACL,eAAe,mBAAmB,MAAM,IAAI,iBAAiB,WAAW,OAAO,GAAG,GAAG,CAAC;AACvF,YAAM,QAAQ;AACd,YAAM;AAAA,IACP,UAAE;AACD,gBAAU,QAAQ;AAAA,IACnB;AAAA,EACD;AAEA,WAAS,aAAa;AACrB,WAAO,IAAI,YAAY;AACtB,YAAM,EAAE,OAAO,IAAI,MAAM,KAAK,WAAW;AACzC,aAAO;AAAA,IACR,CA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,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\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: () => 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() {\n\t\tisLoading.value = true;\n\t\terror.value = null;\n\t\ttry {\n\t\t\tconst { result } = await auth.getUser();\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() {\n\t\tisLoading.value = true;\n\t\ttry {\n\t\t\tconst { result } = await auth.getUser();\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;AAClB,UAAM,QAAQ;AACd,QAAI;AACH,aAAO,MAAM,GAAG;AAAA,IACjB,SAAS,KAAK;AACb,YAAM,WACL,eAAe,mBAAmB,MAAM,IAAI,iBAAiB,WAAW,OAAO,GAAG,GAAG,CAAC;AACvF,YAAM,QAAQ;AACd,YAAM;AAAA,IACP,UAAE;AACD,gBAAU,QAAQ;AAAA,IACnB;AAAA,EACD;AAEA,WAAS,aAAa;AACrB,WAAO,IAAI,YAAY;AACtB,YAAM,EAAE,OAAO,IAAI,MAAM,KAAK,WAAW;AACzC,aAAO;AAAA,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AE;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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fonderie/vue-auth",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "Vue composables for Fonderie auth — thin bindings over @fonderie/client.",
5
5
  "keywords": [
6
6
  "fonderiejs",