@fonderie/vue-auth 0.4.0 → 0.6.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 +307 -67
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +58 -3
- package/dist/index.d.ts +58 -3
- package/dist/index.js +297 -66
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -20,34 +20,55 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// src/index.ts
|
|
21
21
|
var index_exports = {};
|
|
22
22
|
__export(index_exports, {
|
|
23
|
-
FonderieApiError: () =>
|
|
24
|
-
|
|
23
|
+
FonderieApiError: () => import_client12.FonderieApiError,
|
|
24
|
+
TOKEN_KEY: () => TOKEN_KEY,
|
|
25
|
+
clearToken: () => clearToken,
|
|
26
|
+
isMfaRequired: () => import_client12.isMfaRequired,
|
|
27
|
+
persistToken: () => persistToken,
|
|
28
|
+
readToken: () => readToken,
|
|
29
|
+
useAccountData: () => useAccountData,
|
|
30
|
+
useChangePassword: () => useChangePassword,
|
|
25
31
|
useForgotPassword: () => useForgotPassword,
|
|
26
32
|
useLogin: () => useLogin,
|
|
27
33
|
useLogout: () => useLogout,
|
|
34
|
+
useMfaLogin: () => useMfaLogin,
|
|
35
|
+
useMfaSetup: () => useMfaSetup,
|
|
36
|
+
useProfile: () => useProfile,
|
|
28
37
|
useRegister: () => useRegister,
|
|
29
38
|
useResetPassword: () => useResetPassword,
|
|
30
39
|
useSession: () => useSession,
|
|
31
40
|
useVerifyEmail: () => useVerifyEmail
|
|
32
41
|
});
|
|
33
42
|
module.exports = __toCommonJS(index_exports);
|
|
34
|
-
var
|
|
43
|
+
var import_client12 = require("@fonderie/client");
|
|
35
44
|
|
|
36
|
-
// src/composables/
|
|
45
|
+
// src/composables/useAccountData.ts
|
|
37
46
|
var import_client = require("@fonderie/client");
|
|
38
47
|
var import_vue = require("@fonderie/vue");
|
|
39
48
|
var import_vue2 = require("vue");
|
|
40
|
-
|
|
41
|
-
|
|
49
|
+
|
|
50
|
+
// src/storage.ts
|
|
51
|
+
var TOKEN_KEY = "fonderie_access_token";
|
|
52
|
+
function persistToken(token) {
|
|
53
|
+
localStorage.setItem(TOKEN_KEY, token);
|
|
54
|
+
}
|
|
55
|
+
function clearToken() {
|
|
56
|
+
localStorage.removeItem(TOKEN_KEY);
|
|
57
|
+
}
|
|
58
|
+
function readToken() {
|
|
59
|
+
return localStorage.getItem(TOKEN_KEY);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// src/composables/useAccountData.ts
|
|
63
|
+
function useAccountData(client) {
|
|
64
|
+
const auth = (0, import_vue.useFonderieSubClient)(client, (c) => c.auth, "useAccountData");
|
|
42
65
|
const isLoading = (0, import_vue2.ref)(false);
|
|
43
66
|
const error = (0, import_vue2.ref)(null);
|
|
44
|
-
|
|
45
|
-
async function forgotPassword(email) {
|
|
67
|
+
async function run(op) {
|
|
46
68
|
isLoading.value = true;
|
|
47
69
|
error.value = null;
|
|
48
70
|
try {
|
|
49
|
-
await
|
|
50
|
-
sent.value = true;
|
|
71
|
+
return await op();
|
|
51
72
|
} catch (err) {
|
|
52
73
|
const apiError = err instanceof import_client.FonderieApiError ? err : new import_client.FonderieApiError("unknown", String(err), 0);
|
|
53
74
|
error.value = apiError;
|
|
@@ -56,40 +77,92 @@ function useForgotPassword(client) {
|
|
|
56
77
|
isLoading.value = false;
|
|
57
78
|
}
|
|
58
79
|
}
|
|
59
|
-
|
|
80
|
+
function exportData() {
|
|
81
|
+
return run(async () => {
|
|
82
|
+
const { result } = await auth.exportData();
|
|
83
|
+
return result;
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
function deleteUser() {
|
|
87
|
+
return run(async () => {
|
|
88
|
+
await auth.deleteUser();
|
|
89
|
+
auth.setAccessToken(void 0);
|
|
90
|
+
clearToken();
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
return { exportData, deleteUser, isLoading, error };
|
|
60
94
|
}
|
|
61
95
|
|
|
62
|
-
// src/composables/
|
|
96
|
+
// src/composables/useChangePassword.ts
|
|
63
97
|
var import_client2 = require("@fonderie/client");
|
|
64
98
|
var import_vue3 = require("@fonderie/vue");
|
|
65
99
|
var import_vue4 = require("vue");
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
100
|
+
function useChangePassword(client) {
|
|
101
|
+
const auth = (0, import_vue3.useFonderieSubClient)(client, (c) => c.auth, "useChangePassword");
|
|
102
|
+
const isLoading = (0, import_vue4.ref)(false);
|
|
103
|
+
const error = (0, import_vue4.ref)(null);
|
|
104
|
+
const done = (0, import_vue4.ref)(false);
|
|
105
|
+
async function changePassword(input) {
|
|
106
|
+
isLoading.value = true;
|
|
107
|
+
error.value = null;
|
|
108
|
+
done.value = false;
|
|
109
|
+
try {
|
|
110
|
+
await auth.changePassword(input);
|
|
111
|
+
done.value = true;
|
|
112
|
+
} catch (err) {
|
|
113
|
+
const apiError = err instanceof import_client2.FonderieApiError ? err : new import_client2.FonderieApiError("unknown", String(err), 0);
|
|
114
|
+
error.value = apiError;
|
|
115
|
+
throw apiError;
|
|
116
|
+
} finally {
|
|
117
|
+
isLoading.value = false;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
return { changePassword, isLoading, error, done };
|
|
74
121
|
}
|
|
75
|
-
|
|
76
|
-
|
|
122
|
+
|
|
123
|
+
// src/composables/useForgotPassword.ts
|
|
124
|
+
var import_client3 = require("@fonderie/client");
|
|
125
|
+
var import_vue5 = require("@fonderie/vue");
|
|
126
|
+
var import_vue6 = require("vue");
|
|
127
|
+
function useForgotPassword(client) {
|
|
128
|
+
const auth = (0, import_vue5.useFonderieSubClient)(client, (c) => c.auth, "useForgotPassword");
|
|
129
|
+
const isLoading = (0, import_vue6.ref)(false);
|
|
130
|
+
const error = (0, import_vue6.ref)(null);
|
|
131
|
+
const sent = (0, import_vue6.ref)(false);
|
|
132
|
+
async function forgotPassword(email) {
|
|
133
|
+
isLoading.value = true;
|
|
134
|
+
error.value = null;
|
|
135
|
+
try {
|
|
136
|
+
await auth.forgotPassword(email);
|
|
137
|
+
sent.value = true;
|
|
138
|
+
} catch (err) {
|
|
139
|
+
const apiError = err instanceof import_client3.FonderieApiError ? err : new import_client3.FonderieApiError("unknown", String(err), 0);
|
|
140
|
+
error.value = apiError;
|
|
141
|
+
throw apiError;
|
|
142
|
+
} finally {
|
|
143
|
+
isLoading.value = false;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
return { forgotPassword, isLoading, error, sent };
|
|
77
147
|
}
|
|
78
148
|
|
|
79
149
|
// src/composables/useLogin.ts
|
|
150
|
+
var import_client4 = require("@fonderie/client");
|
|
151
|
+
var import_vue7 = require("@fonderie/vue");
|
|
152
|
+
var import_vue8 = require("vue");
|
|
80
153
|
function useLogin(client) {
|
|
81
|
-
const auth = (0,
|
|
82
|
-
const isLoading = (0,
|
|
83
|
-
const error = (0,
|
|
84
|
-
const data = (0,
|
|
85
|
-
const mfaPending = (0,
|
|
154
|
+
const auth = (0, import_vue7.useFonderieSubClient)(client, (c) => c.auth, "useLogin");
|
|
155
|
+
const isLoading = (0, import_vue8.ref)(false);
|
|
156
|
+
const error = (0, import_vue8.ref)(null);
|
|
157
|
+
const data = (0, import_vue8.ref)(null);
|
|
158
|
+
const mfaPending = (0, import_vue8.ref)(null);
|
|
86
159
|
async function login(input) {
|
|
87
160
|
isLoading.value = true;
|
|
88
161
|
error.value = null;
|
|
89
162
|
mfaPending.value = null;
|
|
90
163
|
try {
|
|
91
164
|
const { result } = await auth.login(input);
|
|
92
|
-
if ((0,
|
|
165
|
+
if ((0, import_client4.isMfaRequired)(result)) {
|
|
93
166
|
mfaPending.value = result;
|
|
94
167
|
return result;
|
|
95
168
|
}
|
|
@@ -98,7 +171,7 @@ function useLogin(client) {
|
|
|
98
171
|
data.value = result;
|
|
99
172
|
return result;
|
|
100
173
|
} catch (err) {
|
|
101
|
-
const apiError = err instanceof
|
|
174
|
+
const apiError = err instanceof import_client4.FonderieApiError ? err : new import_client4.FonderieApiError("unknown", String(err), 0);
|
|
102
175
|
error.value = apiError;
|
|
103
176
|
throw apiError;
|
|
104
177
|
} finally {
|
|
@@ -109,20 +182,20 @@ function useLogin(client) {
|
|
|
109
182
|
}
|
|
110
183
|
|
|
111
184
|
// src/composables/useLogout.ts
|
|
112
|
-
var
|
|
113
|
-
var
|
|
114
|
-
var
|
|
185
|
+
var import_client5 = require("@fonderie/client");
|
|
186
|
+
var import_vue9 = require("@fonderie/vue");
|
|
187
|
+
var import_vue10 = require("vue");
|
|
115
188
|
function useLogout(client) {
|
|
116
|
-
const auth = (0,
|
|
117
|
-
const isLoading = (0,
|
|
118
|
-
const error = (0,
|
|
189
|
+
const auth = (0, import_vue9.useFonderieSubClient)(client, (c) => c.auth, "useLogout");
|
|
190
|
+
const isLoading = (0, import_vue10.ref)(false);
|
|
191
|
+
const error = (0, import_vue10.ref)(null);
|
|
119
192
|
async function logout(refreshToken) {
|
|
120
193
|
isLoading.value = true;
|
|
121
194
|
error.value = null;
|
|
122
195
|
try {
|
|
123
196
|
await auth.logout(refreshToken);
|
|
124
197
|
} catch (err) {
|
|
125
|
-
const apiError = err instanceof
|
|
198
|
+
const apiError = err instanceof import_client5.FonderieApiError ? err : new import_client5.FonderieApiError("unknown", String(err), 0);
|
|
126
199
|
error.value = apiError;
|
|
127
200
|
} finally {
|
|
128
201
|
auth.setAccessToken(void 0);
|
|
@@ -133,15 +206,157 @@ function useLogout(client) {
|
|
|
133
206
|
return { logout, isLoading, error };
|
|
134
207
|
}
|
|
135
208
|
|
|
209
|
+
// src/composables/useMfaLogin.ts
|
|
210
|
+
var import_client6 = require("@fonderie/client");
|
|
211
|
+
var import_vue11 = require("@fonderie/vue");
|
|
212
|
+
var import_vue12 = require("vue");
|
|
213
|
+
function useMfaLogin(client) {
|
|
214
|
+
const auth = (0, import_vue11.useFonderieSubClient)(client, (c) => c.auth, "useMfaLogin");
|
|
215
|
+
const isLoading = (0, import_vue12.ref)(false);
|
|
216
|
+
const error = (0, import_vue12.ref)(null);
|
|
217
|
+
const data = (0, import_vue12.ref)(null);
|
|
218
|
+
async function verifyLogin(mfaToken, code) {
|
|
219
|
+
isLoading.value = true;
|
|
220
|
+
error.value = null;
|
|
221
|
+
try {
|
|
222
|
+
const { result } = await auth.mfa.verifyLogin(mfaToken, code);
|
|
223
|
+
auth.setAccessToken(result.tokens.access);
|
|
224
|
+
persistToken(result.tokens.access);
|
|
225
|
+
data.value = result;
|
|
226
|
+
return result;
|
|
227
|
+
} catch (err) {
|
|
228
|
+
const apiError = err instanceof import_client6.FonderieApiError ? err : new import_client6.FonderieApiError("unknown", String(err), 0);
|
|
229
|
+
error.value = apiError;
|
|
230
|
+
throw apiError;
|
|
231
|
+
} finally {
|
|
232
|
+
isLoading.value = false;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
return { verifyLogin, isLoading, error, data };
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
// src/composables/useMfaSetup.ts
|
|
239
|
+
var import_client7 = require("@fonderie/client");
|
|
240
|
+
var import_vue13 = require("@fonderie/vue");
|
|
241
|
+
var import_vue14 = require("vue");
|
|
242
|
+
function useMfaSetup(client) {
|
|
243
|
+
const auth = (0, import_vue13.useFonderieSubClient)(client, (c) => c.auth, "useMfaSetup");
|
|
244
|
+
const setupData = (0, import_vue14.ref)(null);
|
|
245
|
+
const isLoading = (0, import_vue14.ref)(false);
|
|
246
|
+
const error = (0, import_vue14.ref)(null);
|
|
247
|
+
async function run(op) {
|
|
248
|
+
isLoading.value = true;
|
|
249
|
+
error.value = null;
|
|
250
|
+
try {
|
|
251
|
+
return await op();
|
|
252
|
+
} catch (err) {
|
|
253
|
+
const apiError = err instanceof import_client7.FonderieApiError ? err : new import_client7.FonderieApiError("unknown", String(err), 0);
|
|
254
|
+
error.value = apiError;
|
|
255
|
+
throw apiError;
|
|
256
|
+
} finally {
|
|
257
|
+
isLoading.value = false;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
function setup() {
|
|
261
|
+
return run(async () => {
|
|
262
|
+
const { result } = await auth.mfa.setup();
|
|
263
|
+
setupData.value = result;
|
|
264
|
+
return result;
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
function verify(code) {
|
|
268
|
+
return run(async () => {
|
|
269
|
+
const { result } = await auth.mfa.verify(code);
|
|
270
|
+
auth.setAccessToken(result.tokens.access);
|
|
271
|
+
persistToken(result.tokens.access);
|
|
272
|
+
return result;
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
function disable(code) {
|
|
276
|
+
return run(async () => {
|
|
277
|
+
await auth.mfa.disable(code);
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
function regenerateBackupCodes(code) {
|
|
281
|
+
return run(async () => {
|
|
282
|
+
const { result } = await auth.mfa.regenerateBackupCodes(code);
|
|
283
|
+
return result.backupCodes;
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
return { setup, setupData, verify, disable, regenerateBackupCodes, isLoading, error };
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
// src/composables/useProfile.ts
|
|
290
|
+
var import_client8 = require("@fonderie/client");
|
|
291
|
+
var import_vue15 = require("@fonderie/vue");
|
|
292
|
+
var import_vue16 = require("vue");
|
|
293
|
+
function useProfile(client) {
|
|
294
|
+
const auth = (0, import_vue15.useFonderieSubClient)(client, (c) => c.auth, "useProfile");
|
|
295
|
+
const user = (0, import_vue16.ref)(null);
|
|
296
|
+
const isLoading = (0, import_vue16.ref)(true);
|
|
297
|
+
const error = (0, import_vue16.ref)(null);
|
|
298
|
+
async function refresh() {
|
|
299
|
+
isLoading.value = true;
|
|
300
|
+
error.value = null;
|
|
301
|
+
try {
|
|
302
|
+
const { result } = await auth.getUser();
|
|
303
|
+
user.value = result.user;
|
|
304
|
+
} catch (err) {
|
|
305
|
+
const apiError = err instanceof import_client8.FonderieApiError ? err : new import_client8.FonderieApiError("unknown", String(err), 0);
|
|
306
|
+
error.value = apiError;
|
|
307
|
+
} finally {
|
|
308
|
+
isLoading.value = false;
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
async function mutate(op) {
|
|
312
|
+
error.value = null;
|
|
313
|
+
try {
|
|
314
|
+
return await op();
|
|
315
|
+
} catch (err) {
|
|
316
|
+
const apiError = err instanceof import_client8.FonderieApiError ? err : new import_client8.FonderieApiError("unknown", String(err), 0);
|
|
317
|
+
error.value = apiError;
|
|
318
|
+
throw apiError;
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
function updateProfile(input) {
|
|
322
|
+
return mutate(async () => {
|
|
323
|
+
const { result } = await auth.updateProfile(input);
|
|
324
|
+
user.value = result.user;
|
|
325
|
+
return result.user;
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
function updatePreferences(input) {
|
|
329
|
+
return mutate(async () => {
|
|
330
|
+
const { result } = await auth.updatePreferences(input);
|
|
331
|
+
user.value = result.user;
|
|
332
|
+
return result.user;
|
|
333
|
+
});
|
|
334
|
+
}
|
|
335
|
+
function updateEmail(email) {
|
|
336
|
+
return mutate(async () => {
|
|
337
|
+
await auth.updateEmail(email);
|
|
338
|
+
await refresh();
|
|
339
|
+
});
|
|
340
|
+
}
|
|
341
|
+
function updatePhone(phone) {
|
|
342
|
+
return mutate(async () => {
|
|
343
|
+
await auth.updatePhone(phone);
|
|
344
|
+
await refresh();
|
|
345
|
+
});
|
|
346
|
+
}
|
|
347
|
+
void refresh();
|
|
348
|
+
return { user, refresh, updateProfile, updatePreferences, updateEmail, updatePhone, isLoading, error };
|
|
349
|
+
}
|
|
350
|
+
|
|
136
351
|
// src/composables/useRegister.ts
|
|
137
|
-
var
|
|
138
|
-
var
|
|
139
|
-
var
|
|
352
|
+
var import_client9 = require("@fonderie/client");
|
|
353
|
+
var import_vue17 = require("@fonderie/vue");
|
|
354
|
+
var import_vue18 = require("vue");
|
|
140
355
|
function useRegister(client) {
|
|
141
|
-
const auth = (0,
|
|
142
|
-
const isLoading = (0,
|
|
143
|
-
const error = (0,
|
|
144
|
-
const data = (0,
|
|
356
|
+
const auth = (0, import_vue17.useFonderieSubClient)(client, (c) => c.auth, "useRegister");
|
|
357
|
+
const isLoading = (0, import_vue18.ref)(false);
|
|
358
|
+
const error = (0, import_vue18.ref)(null);
|
|
359
|
+
const data = (0, import_vue18.ref)(null);
|
|
145
360
|
async function register(input) {
|
|
146
361
|
isLoading.value = true;
|
|
147
362
|
error.value = null;
|
|
@@ -152,7 +367,7 @@ function useRegister(client) {
|
|
|
152
367
|
data.value = result;
|
|
153
368
|
return result;
|
|
154
369
|
} catch (err) {
|
|
155
|
-
const apiError = err instanceof
|
|
370
|
+
const apiError = err instanceof import_client9.FonderieApiError ? err : new import_client9.FonderieApiError("unknown", String(err), 0);
|
|
156
371
|
error.value = apiError;
|
|
157
372
|
throw apiError;
|
|
158
373
|
} finally {
|
|
@@ -163,14 +378,14 @@ function useRegister(client) {
|
|
|
163
378
|
}
|
|
164
379
|
|
|
165
380
|
// src/composables/useResetPassword.ts
|
|
166
|
-
var
|
|
167
|
-
var
|
|
168
|
-
var
|
|
381
|
+
var import_client10 = require("@fonderie/client");
|
|
382
|
+
var import_vue19 = require("@fonderie/vue");
|
|
383
|
+
var import_vue20 = require("vue");
|
|
169
384
|
function useResetPassword(client) {
|
|
170
|
-
const auth = (0,
|
|
171
|
-
const isLoading = (0,
|
|
172
|
-
const error = (0,
|
|
173
|
-
const done = (0,
|
|
385
|
+
const auth = (0, import_vue19.useFonderieSubClient)(client, (c) => c.auth, "useResetPassword");
|
|
386
|
+
const isLoading = (0, import_vue20.ref)(false);
|
|
387
|
+
const error = (0, import_vue20.ref)(null);
|
|
388
|
+
const done = (0, import_vue20.ref)(false);
|
|
174
389
|
async function resetPassword(input) {
|
|
175
390
|
isLoading.value = true;
|
|
176
391
|
error.value = null;
|
|
@@ -178,7 +393,7 @@ function useResetPassword(client) {
|
|
|
178
393
|
await auth.resetPassword(input);
|
|
179
394
|
done.value = true;
|
|
180
395
|
} catch (err) {
|
|
181
|
-
const apiError = err instanceof
|
|
396
|
+
const apiError = err instanceof import_client10.FonderieApiError ? err : new import_client10.FonderieApiError("unknown", String(err), 0);
|
|
182
397
|
error.value = apiError;
|
|
183
398
|
throw apiError;
|
|
184
399
|
} finally {
|
|
@@ -189,13 +404,13 @@ function useResetPassword(client) {
|
|
|
189
404
|
}
|
|
190
405
|
|
|
191
406
|
// src/composables/useSession.ts
|
|
192
|
-
var
|
|
193
|
-
var
|
|
407
|
+
var import_vue21 = require("@fonderie/vue");
|
|
408
|
+
var import_vue22 = require("vue");
|
|
194
409
|
function useSession(client) {
|
|
195
|
-
const auth = (0,
|
|
196
|
-
const user = (0,
|
|
197
|
-
const isLoading = (0,
|
|
198
|
-
const isAuthenticated = (0,
|
|
410
|
+
const auth = (0, import_vue21.useFonderieSubClient)(client, (c) => c.auth, "useSession");
|
|
411
|
+
const user = (0, import_vue22.ref)(null);
|
|
412
|
+
const isLoading = (0, import_vue22.ref)(true);
|
|
413
|
+
const isAuthenticated = (0, import_vue22.ref)(false);
|
|
199
414
|
async function refresh() {
|
|
200
415
|
isLoading.value = true;
|
|
201
416
|
try {
|
|
@@ -228,14 +443,30 @@ function useSession(client) {
|
|
|
228
443
|
}
|
|
229
444
|
|
|
230
445
|
// src/composables/useVerifyEmail.ts
|
|
231
|
-
var
|
|
232
|
-
var
|
|
233
|
-
var
|
|
446
|
+
var import_client11 = require("@fonderie/client");
|
|
447
|
+
var import_vue23 = require("@fonderie/vue");
|
|
448
|
+
var import_vue24 = require("vue");
|
|
234
449
|
function useVerifyEmail(client) {
|
|
235
|
-
const auth = (0,
|
|
236
|
-
const isLoading = (0,
|
|
237
|
-
const error = (0,
|
|
238
|
-
const data = (0,
|
|
450
|
+
const auth = (0, import_vue23.useFonderieSubClient)(client, (c) => c.auth, "useVerifyEmail");
|
|
451
|
+
const isLoading = (0, import_vue24.ref)(false);
|
|
452
|
+
const error = (0, import_vue24.ref)(null);
|
|
453
|
+
const data = (0, import_vue24.ref)(null);
|
|
454
|
+
const resent = (0, import_vue24.ref)(false);
|
|
455
|
+
async function resend() {
|
|
456
|
+
isLoading.value = true;
|
|
457
|
+
error.value = null;
|
|
458
|
+
resent.value = false;
|
|
459
|
+
try {
|
|
460
|
+
await auth.sendVerificationEmail();
|
|
461
|
+
resent.value = true;
|
|
462
|
+
} catch (err) {
|
|
463
|
+
const apiError = err instanceof import_client11.FonderieApiError ? err : new import_client11.FonderieApiError("unknown", String(err), 0);
|
|
464
|
+
error.value = apiError;
|
|
465
|
+
throw apiError;
|
|
466
|
+
} finally {
|
|
467
|
+
isLoading.value = false;
|
|
468
|
+
}
|
|
469
|
+
}
|
|
239
470
|
async function verifyEmail(pin) {
|
|
240
471
|
isLoading.value = true;
|
|
241
472
|
error.value = null;
|
|
@@ -244,22 +475,31 @@ function useVerifyEmail(client) {
|
|
|
244
475
|
data.value = result;
|
|
245
476
|
return result;
|
|
246
477
|
} catch (err) {
|
|
247
|
-
const apiError = err instanceof
|
|
478
|
+
const apiError = err instanceof import_client11.FonderieApiError ? err : new import_client11.FonderieApiError("unknown", String(err), 0);
|
|
248
479
|
error.value = apiError;
|
|
249
480
|
throw apiError;
|
|
250
481
|
} finally {
|
|
251
482
|
isLoading.value = false;
|
|
252
483
|
}
|
|
253
484
|
}
|
|
254
|
-
return { verifyEmail, isLoading, error, data };
|
|
485
|
+
return { verifyEmail, resend, resent, isLoading, error, data };
|
|
255
486
|
}
|
|
256
487
|
// Annotate the CommonJS export names for ESM import in node:
|
|
257
488
|
0 && (module.exports = {
|
|
258
489
|
FonderieApiError,
|
|
490
|
+
TOKEN_KEY,
|
|
491
|
+
clearToken,
|
|
259
492
|
isMfaRequired,
|
|
493
|
+
persistToken,
|
|
494
|
+
readToken,
|
|
495
|
+
useAccountData,
|
|
496
|
+
useChangePassword,
|
|
260
497
|
useForgotPassword,
|
|
261
498
|
useLogin,
|
|
262
499
|
useLogout,
|
|
500
|
+
useMfaLogin,
|
|
501
|
+
useMfaSetup,
|
|
502
|
+
useProfile,
|
|
263
503
|
useRegister,
|
|
264
504
|
useResetPassword,
|
|
265
505
|
useSession,
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/composables/useForgotPassword.ts","../src/composables/useLogin.ts","../src/storage.ts","../src/composables/useLogout.ts","../src/composables/useRegister.ts","../src/composables/useResetPassword.ts","../src/composables/useSession.ts","../src/composables/useVerifyEmail.ts"],"sourcesContent":["export type {\n\tAuthClient,\n\tILoginInput,\n\tILoginResult,\n\tIMfaRequiredResult,\n\tIRegisterInput,\n\tIRegisterResult,\n\tIResetPasswordInput,\n\tITokens,\n\tIUserDTO,\n\tIVerifyEmailResult,\n} from '@fonderie/client';\n\nexport { FonderieApiError, isMfaRequired } from '@fonderie/client';\n\nexport {\n\tuseForgotPassword,\n\tuseLogin,\n\tuseLogout,\n\tuseRegister,\n\tuseResetPassword,\n\tuseSession,\n\tuseVerifyEmail,\n} from './composables';\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","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 } 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, 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\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, isLoading, error, data };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAaA,IAAAA,iBAAgD;;;ACZhD,oBAAiC;AACjC,iBAAqC;AACrC,IAAAC,cAAoB;AAEb,SAAS,kBAAkB,QAAqB;AACtD,QAAM,WAAO,iCAAqB,QAAQ,CAAC,MAAM,EAAE,MAAM,mBAAmB;AAC5E,QAAM,gBAAY,iBAAI,KAAK;AAC3B,QAAM,YAAQ,iBAA6B,IAAI;AAC/C,QAAM,WAAO,iBAAI,KAAK;AAEtB,iBAAe,eAAe,OAAe;AAC5C,cAAU,QAAQ;AAClB,UAAM,QAAQ;AACd,QAAI;AACH,YAAM,KAAK,eAAe,KAAK;AAC/B,WAAK,QAAQ;AAAA,IACd,SAAS,KAA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,iBAAW;AAAA,IACZ,UAAE;AACD,gBAAU,QAAQ;AAAA,IACnB;AAAA,EACD;AAEA,iBAAe,OAAO,cAAuB;AAC5C,QAAI;AACH,YAAM,KAAK,OAAO,YAAY;AAAA,IAC/B,QAAQ;AAAA,IAER;AACA,SAAK,eAAe,MAAS;AAC7B,eAAW;AACX,SAAK,QAAQ;AACb,oBAAgB,QAAQ;AAAA,EACzB;AAEA,QAAM,QAAQ,UAAU;AACxB,MAAI,MAAO,MAAK,eAAe,KAAK;AACpC,OAAK,QAAQ;AAEb,SAAO,EAAE,MAAM,WAAW,iBAAiB,SAAS,OAAO;AAC5D;;;AC3CA,IAAAC,iBAAiC;AACjC,IAAAC,eAAqC;AACrC,IAAAA,eAAoB;AAEb,SAAS,eAAe,QAAqB;AACnD,QAAM,WAAO,mCAAqB,QAAQ,CAAC,MAAM,EAAE,MAAM,gBAAgB;AACzE,QAAM,gBAAY,kBAAI,KAAK;AAC3B,QAAM,YAAQ,kBAA6B,IAAI;AAC/C,QAAM,WAAO,kBAA+B,IAAI;AAEhD,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,kCAAmB,MAAM,IAAI,gCAAiB,WAAW,OAAO,GAAG,GAAG,CAAC;AACvF,YAAM,QAAQ;AACd,YAAM;AAAA,IACP,UAAE;AACD,gBAAU,QAAQ;AAAA,IACnB;AAAA,EACD;AAEA,SAAO,EAAE,aAAa,WAAW,OAAO,KAAK;AAC9C;","names":["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 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;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;AAC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AM,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"]}
|