@choiceform/shared-auth 0.1.18 → 0.1.19
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/README.md +370 -139
- package/dist/core.d.ts +109 -66
- package/dist/core.d.ts.map +1 -1
- package/dist/core.js +3 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/init.d.ts +109 -66
- package/dist/init.d.ts.map +1 -1
- package/dist/lib/auth-client.d.ts +108 -66
- package/dist/lib/auth-client.d.ts.map +1 -1
- package/dist/services/index.d.ts +1 -0
- package/dist/services/index.d.ts.map +1 -1
- package/dist/services/index.js +1 -0
- package/dist/services/referral-service.d.ts +54 -0
- package/dist/services/referral-service.d.ts.map +1 -0
- package/dist/services/referral-service.js +54 -0
- package/dist/store/utils.d.ts +1 -1
- package/dist/store/utils.d.ts.map +1 -1
- package/dist/types/user.d.ts +4 -0
- package/dist/types/user.d.ts.map +1 -1
- package/dist/utils/user-mapper.d.ts.map +1 -1
- package/dist/utils/user-mapper.js +2 -0
- package/package.json +11 -12
- package/dist/components/auth-sync.d.ts +0 -27
- package/dist/components/auth-sync.d.ts.map +0 -1
- package/dist/components/auth-sync.js +0 -117
- package/dist/components/protected-route.d.ts +0 -18
- package/dist/components/protected-route.d.ts.map +0 -1
- package/dist/components/protected-route.js +0 -34
- package/dist/components/sign-in-page.d.ts +0 -21
- package/dist/components/sign-in-page.d.ts.map +0 -1
- package/dist/components/sign-in-page.js +0 -31
package/dist/init.d.ts
CHANGED
|
@@ -154,6 +154,7 @@ export declare function initAuth(config: InitAuthConfig): {
|
|
|
154
154
|
success: boolean;
|
|
155
155
|
}>;
|
|
156
156
|
};
|
|
157
|
+
referralService: import("./services").ReferralService;
|
|
157
158
|
setActiveOrganization: (request: import("./types").SetActiveOrganizationRequest) => Promise<import("./types").Organization>;
|
|
158
159
|
setActiveTeam: (request: import("./types").SetActiveTeamRequest) => Promise<void>;
|
|
159
160
|
setActiveOrganizationAndTeam: (organizationId: string, teamId: string) => Promise<import("./types").Organization>;
|
|
@@ -176,7 +177,7 @@ export declare function initAuth(config: InitAuthConfig): {
|
|
|
176
177
|
requestSignUp?: boolean | undefined;
|
|
177
178
|
loginHint?: string | undefined;
|
|
178
179
|
additionalData?: Record<string, any> | undefined;
|
|
179
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth
|
|
180
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
|
|
180
181
|
provider: (string & {}) | "github" | "apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "vercel";
|
|
181
182
|
callbackURL?: string | undefined;
|
|
182
183
|
newUserCallbackURL?: string | undefined;
|
|
@@ -195,7 +196,7 @@ export declare function initAuth(config: InitAuthConfig): {
|
|
|
195
196
|
additionalData?: Record<string, any> | undefined;
|
|
196
197
|
} & {
|
|
197
198
|
fetchOptions?: FetchOptions | undefined;
|
|
198
|
-
}>, data_1?: FetchOptions | undefined) => Promise<import("
|
|
199
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/client").BetterFetchResponse<NonNullable<{
|
|
199
200
|
redirect: boolean;
|
|
200
201
|
url: string;
|
|
201
202
|
} | {
|
|
@@ -217,10 +218,10 @@ export declare function initAuth(config: InitAuthConfig): {
|
|
|
217
218
|
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
218
219
|
};
|
|
219
220
|
} & {
|
|
220
|
-
signOut: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth
|
|
221
|
+
signOut: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth").Prettify<{
|
|
221
222
|
query?: Record<string, any> | undefined;
|
|
222
223
|
fetchOptions?: FetchOptions | undefined;
|
|
223
|
-
}> | undefined, data_1?: FetchOptions | undefined) => Promise<import("
|
|
224
|
+
}> | undefined, data_1?: FetchOptions | undefined) => Promise<import("better-auth/client").BetterFetchResponse<{
|
|
224
225
|
success: boolean;
|
|
225
226
|
}, {
|
|
226
227
|
code?: string | undefined;
|
|
@@ -235,14 +236,14 @@ export declare function initAuth(config: InitAuthConfig): {
|
|
|
235
236
|
image?: string | undefined;
|
|
236
237
|
callbackURL?: string | undefined;
|
|
237
238
|
rememberMe?: boolean | undefined;
|
|
238
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth
|
|
239
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
|
|
239
240
|
email: string;
|
|
240
241
|
name: string;
|
|
241
242
|
password: string;
|
|
242
243
|
image?: string | undefined;
|
|
243
244
|
callbackURL?: string | undefined;
|
|
244
245
|
fetchOptions?: FetchOptions | undefined;
|
|
245
|
-
}>, data_1?: FetchOptions | undefined) => Promise<import("
|
|
246
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/client").BetterFetchResponse<NonNullable<{
|
|
246
247
|
token: null;
|
|
247
248
|
user: {
|
|
248
249
|
id: string;
|
|
@@ -276,14 +277,14 @@ export declare function initAuth(config: InitAuthConfig): {
|
|
|
276
277
|
password: string;
|
|
277
278
|
callbackURL?: string | undefined;
|
|
278
279
|
rememberMe?: boolean | undefined;
|
|
279
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth
|
|
280
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
|
|
280
281
|
email: string;
|
|
281
282
|
password: string;
|
|
282
283
|
callbackURL?: string | undefined;
|
|
283
284
|
rememberMe?: boolean | undefined;
|
|
284
285
|
} & {
|
|
285
286
|
fetchOptions?: FetchOptions | undefined;
|
|
286
|
-
}>, data_1?: FetchOptions | undefined) => Promise<import("
|
|
287
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/client").BetterFetchResponse<{
|
|
287
288
|
redirect: boolean;
|
|
288
289
|
token: string;
|
|
289
290
|
url?: string | undefined;
|
|
@@ -307,12 +308,12 @@ export declare function initAuth(config: InitAuthConfig): {
|
|
|
307
308
|
token?: string | undefined;
|
|
308
309
|
}> & Record<string, any>, Partial<{
|
|
309
310
|
token?: string | undefined;
|
|
310
|
-
}> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth
|
|
311
|
+
}> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
|
|
311
312
|
newPassword: string;
|
|
312
313
|
token?: string | undefined;
|
|
313
314
|
} & {
|
|
314
315
|
fetchOptions?: FetchOptions | undefined;
|
|
315
|
-
}>, data_1?: FetchOptions | undefined) => Promise<import("
|
|
316
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/client").BetterFetchResponse<{
|
|
316
317
|
status: boolean;
|
|
317
318
|
}, {
|
|
318
319
|
code?: string | undefined;
|
|
@@ -322,13 +323,13 @@ export declare function initAuth(config: InitAuthConfig): {
|
|
|
322
323
|
verifyEmail: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<{
|
|
323
324
|
token: string;
|
|
324
325
|
callbackURL?: string | undefined;
|
|
325
|
-
}> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth
|
|
326
|
+
}> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
|
|
326
327
|
query: {
|
|
327
328
|
token: string;
|
|
328
329
|
callbackURL?: string | undefined;
|
|
329
330
|
};
|
|
330
331
|
fetchOptions?: FetchOptions | undefined;
|
|
331
|
-
}>, data_1?: FetchOptions | undefined) => Promise<import("
|
|
332
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/client").BetterFetchResponse<NonNullable<void | {
|
|
332
333
|
status: boolean;
|
|
333
334
|
}>, {
|
|
334
335
|
code?: string | undefined;
|
|
@@ -338,12 +339,12 @@ export declare function initAuth(config: InitAuthConfig): {
|
|
|
338
339
|
sendVerificationEmail: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
|
|
339
340
|
email: string;
|
|
340
341
|
callbackURL?: string | undefined;
|
|
341
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth
|
|
342
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
|
|
342
343
|
email: string;
|
|
343
344
|
callbackURL?: string | undefined;
|
|
344
345
|
} & {
|
|
345
346
|
fetchOptions?: FetchOptions | undefined;
|
|
346
|
-
}>, data_1?: FetchOptions | undefined) => Promise<import("
|
|
347
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/client").BetterFetchResponse<{
|
|
347
348
|
status: boolean;
|
|
348
349
|
}, {
|
|
349
350
|
code?: string | undefined;
|
|
@@ -353,12 +354,12 @@ export declare function initAuth(config: InitAuthConfig): {
|
|
|
353
354
|
changeEmail: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
|
|
354
355
|
newEmail: string;
|
|
355
356
|
callbackURL?: string | undefined;
|
|
356
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth
|
|
357
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
|
|
357
358
|
newEmail: string;
|
|
358
359
|
callbackURL?: string | undefined;
|
|
359
360
|
} & {
|
|
360
361
|
fetchOptions?: FetchOptions | undefined;
|
|
361
|
-
}>, data_1?: FetchOptions | undefined) => Promise<import("
|
|
362
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/client").BetterFetchResponse<{
|
|
362
363
|
status: boolean;
|
|
363
364
|
}, {
|
|
364
365
|
code?: string | undefined;
|
|
@@ -369,13 +370,13 @@ export declare function initAuth(config: InitAuthConfig): {
|
|
|
369
370
|
newPassword: string;
|
|
370
371
|
currentPassword: string;
|
|
371
372
|
revokeOtherSessions?: boolean | undefined;
|
|
372
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth
|
|
373
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
|
|
373
374
|
newPassword: string;
|
|
374
375
|
currentPassword: string;
|
|
375
376
|
revokeOtherSessions?: boolean | undefined;
|
|
376
377
|
} & {
|
|
377
378
|
fetchOptions?: FetchOptions | undefined;
|
|
378
|
-
}>, data_1?: FetchOptions | undefined) => Promise<import("
|
|
379
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/client").BetterFetchResponse<{
|
|
379
380
|
token: string | null;
|
|
380
381
|
user: {
|
|
381
382
|
id: string;
|
|
@@ -393,12 +394,12 @@ export declare function initAuth(config: InitAuthConfig): {
|
|
|
393
394
|
} & {
|
|
394
395
|
updateUser: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<Partial<{}> & {
|
|
395
396
|
name?: string | undefined;
|
|
396
|
-
image?: string | undefined;
|
|
397
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth
|
|
397
|
+
image?: string | undefined | null;
|
|
398
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth").Prettify<{
|
|
398
399
|
image?: (string | null) | undefined;
|
|
399
400
|
name?: string | undefined;
|
|
400
401
|
fetchOptions?: FetchOptions | undefined;
|
|
401
|
-
} & Partial<{}>> | undefined, data_1?: FetchOptions | undefined) => Promise<import("
|
|
402
|
+
} & Partial<{}>> | undefined, data_1?: FetchOptions | undefined) => Promise<import("better-auth/client").BetterFetchResponse<{
|
|
402
403
|
status: boolean;
|
|
403
404
|
}, {
|
|
404
405
|
code?: string | undefined;
|
|
@@ -409,13 +410,13 @@ export declare function initAuth(config: InitAuthConfig): {
|
|
|
409
410
|
callbackURL?: string | undefined;
|
|
410
411
|
password?: string | undefined;
|
|
411
412
|
token?: string | undefined;
|
|
412
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth
|
|
413
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth").Prettify<{
|
|
413
414
|
callbackURL?: string | undefined;
|
|
414
415
|
password?: string | undefined;
|
|
415
416
|
token?: string | undefined;
|
|
416
417
|
} & {
|
|
417
418
|
fetchOptions?: FetchOptions | undefined;
|
|
418
|
-
}> | undefined, data_1?: FetchOptions | undefined) => Promise<import("
|
|
419
|
+
}> | undefined, data_1?: FetchOptions | undefined) => Promise<import("better-auth/client").BetterFetchResponse<{
|
|
419
420
|
success: boolean;
|
|
420
421
|
message: string;
|
|
421
422
|
}, {
|
|
@@ -426,12 +427,12 @@ export declare function initAuth(config: InitAuthConfig): {
|
|
|
426
427
|
requestPasswordReset: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
|
|
427
428
|
email: string;
|
|
428
429
|
redirectTo?: string | undefined;
|
|
429
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth
|
|
430
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
|
|
430
431
|
email: string;
|
|
431
432
|
redirectTo?: string | undefined;
|
|
432
433
|
} & {
|
|
433
434
|
fetchOptions?: FetchOptions | undefined;
|
|
434
|
-
}>, data_1?: FetchOptions | undefined) => Promise<import("
|
|
435
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/client").BetterFetchResponse<{
|
|
435
436
|
status: boolean;
|
|
436
437
|
message: string;
|
|
437
438
|
}, {
|
|
@@ -444,21 +445,21 @@ export declare function initAuth(config: InitAuthConfig): {
|
|
|
444
445
|
callbackURL: string;
|
|
445
446
|
}> & Record<string, any>, {
|
|
446
447
|
token: string;
|
|
447
|
-
}>>(data_0: import("better-auth
|
|
448
|
+
}>>(data_0: import("better-auth").Prettify<{
|
|
448
449
|
query: {
|
|
449
450
|
callbackURL: string;
|
|
450
451
|
};
|
|
451
452
|
fetchOptions?: FetchOptions | undefined;
|
|
452
|
-
}>, data_1?: FetchOptions | undefined) => Promise<import("
|
|
453
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/client").BetterFetchResponse<never, {
|
|
453
454
|
code?: string | undefined;
|
|
454
455
|
message?: string | undefined;
|
|
455
456
|
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
456
457
|
};
|
|
457
458
|
} & {
|
|
458
|
-
listSessions: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth
|
|
459
|
+
listSessions: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth").Prettify<{
|
|
459
460
|
query?: Record<string, any> | undefined;
|
|
460
461
|
fetchOptions?: FetchOptions | undefined;
|
|
461
|
-
}> | undefined, data_1?: FetchOptions | undefined) => Promise<import("
|
|
462
|
+
}> | undefined, data_1?: FetchOptions | undefined) => Promise<import("better-auth/client").BetterFetchResponse<import("better-auth").Prettify<{
|
|
462
463
|
id: string;
|
|
463
464
|
createdAt: Date;
|
|
464
465
|
updatedAt: Date;
|
|
@@ -474,31 +475,31 @@ export declare function initAuth(config: InitAuthConfig): {
|
|
|
474
475
|
} & {
|
|
475
476
|
revokeSession: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
|
|
476
477
|
token: string;
|
|
477
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth
|
|
478
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
|
|
478
479
|
token: string;
|
|
479
480
|
} & {
|
|
480
481
|
fetchOptions?: FetchOptions | undefined;
|
|
481
|
-
}>, data_1?: FetchOptions | undefined) => Promise<import("
|
|
482
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/client").BetterFetchResponse<{
|
|
482
483
|
status: boolean;
|
|
483
484
|
}, {
|
|
484
485
|
code?: string | undefined;
|
|
485
486
|
message?: string | undefined;
|
|
486
487
|
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
487
488
|
} & {
|
|
488
|
-
revokeSessions: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth
|
|
489
|
+
revokeSessions: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth").Prettify<{
|
|
489
490
|
query?: Record<string, any> | undefined;
|
|
490
491
|
fetchOptions?: FetchOptions | undefined;
|
|
491
|
-
}> | undefined, data_1?: FetchOptions | undefined) => Promise<import("
|
|
492
|
+
}> | undefined, data_1?: FetchOptions | undefined) => Promise<import("better-auth/client").BetterFetchResponse<{
|
|
492
493
|
status: boolean;
|
|
493
494
|
}, {
|
|
494
495
|
code?: string | undefined;
|
|
495
496
|
message?: string | undefined;
|
|
496
497
|
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
497
498
|
} & {
|
|
498
|
-
revokeOtherSessions: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth
|
|
499
|
+
revokeOtherSessions: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth").Prettify<{
|
|
499
500
|
query?: Record<string, any> | undefined;
|
|
500
501
|
fetchOptions?: FetchOptions | undefined;
|
|
501
|
-
}> | undefined, data_1?: FetchOptions | undefined) => Promise<import("
|
|
502
|
+
}> | undefined, data_1?: FetchOptions | undefined) => Promise<import("better-auth/client").BetterFetchResponse<{
|
|
502
503
|
status: boolean;
|
|
503
504
|
}, {
|
|
504
505
|
code?: string | undefined;
|
|
@@ -520,7 +521,7 @@ export declare function initAuth(config: InitAuthConfig): {
|
|
|
520
521
|
errorCallbackURL?: string | undefined;
|
|
521
522
|
disableRedirect?: boolean | undefined;
|
|
522
523
|
additionalData?: Record<string, any> | undefined;
|
|
523
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth
|
|
524
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
|
|
524
525
|
provider: unknown;
|
|
525
526
|
callbackURL?: string | undefined;
|
|
526
527
|
idToken?: {
|
|
@@ -537,7 +538,7 @@ export declare function initAuth(config: InitAuthConfig): {
|
|
|
537
538
|
additionalData?: Record<string, any> | undefined;
|
|
538
539
|
} & {
|
|
539
540
|
fetchOptions?: FetchOptions | undefined;
|
|
540
|
-
}>, data_1?: FetchOptions | undefined) => Promise<import("
|
|
541
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/client").BetterFetchResponse<{
|
|
541
542
|
url: string;
|
|
542
543
|
redirect: boolean;
|
|
543
544
|
}, {
|
|
@@ -545,10 +546,10 @@ export declare function initAuth(config: InitAuthConfig): {
|
|
|
545
546
|
message?: string | undefined;
|
|
546
547
|
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
547
548
|
} & {
|
|
548
|
-
listAccounts: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth
|
|
549
|
+
listAccounts: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth").Prettify<{
|
|
549
550
|
query?: Record<string, any> | undefined;
|
|
550
551
|
fetchOptions?: FetchOptions | undefined;
|
|
551
|
-
}> | undefined, data_1?: FetchOptions | undefined) => Promise<import("
|
|
552
|
+
}> | undefined, data_1?: FetchOptions | undefined) => Promise<import("better-auth/client").BetterFetchResponse<{
|
|
552
553
|
id: string;
|
|
553
554
|
providerId: string;
|
|
554
555
|
createdAt: Date;
|
|
@@ -565,13 +566,13 @@ export declare function initAuth(config: InitAuthConfig): {
|
|
|
565
566
|
callback: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<{
|
|
566
567
|
token: string;
|
|
567
568
|
callbackURL?: string | undefined;
|
|
568
|
-
}> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth
|
|
569
|
+
}> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
|
|
569
570
|
query: {
|
|
570
571
|
token: string;
|
|
571
572
|
callbackURL?: string | undefined;
|
|
572
573
|
};
|
|
573
574
|
fetchOptions?: FetchOptions | undefined;
|
|
574
|
-
}>, data_1?: FetchOptions | undefined) => Promise<import("
|
|
575
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/client").BetterFetchResponse<{
|
|
575
576
|
success: boolean;
|
|
576
577
|
message: string;
|
|
577
578
|
}, {
|
|
@@ -583,12 +584,12 @@ export declare function initAuth(config: InitAuthConfig): {
|
|
|
583
584
|
unlinkAccount: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
|
|
584
585
|
providerId: string;
|
|
585
586
|
accountId?: string | undefined;
|
|
586
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth
|
|
587
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
|
|
587
588
|
providerId: string;
|
|
588
589
|
accountId?: string | undefined;
|
|
589
590
|
} & {
|
|
590
591
|
fetchOptions?: FetchOptions | undefined;
|
|
591
|
-
}>, data_1?: FetchOptions | undefined) => Promise<import("
|
|
592
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/client").BetterFetchResponse<{
|
|
592
593
|
status: boolean;
|
|
593
594
|
}, {
|
|
594
595
|
code?: string | undefined;
|
|
@@ -599,13 +600,13 @@ export declare function initAuth(config: InitAuthConfig): {
|
|
|
599
600
|
providerId: string;
|
|
600
601
|
accountId?: string | undefined;
|
|
601
602
|
userId?: string | undefined;
|
|
602
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth
|
|
603
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
|
|
603
604
|
providerId: string;
|
|
604
605
|
accountId?: string | undefined;
|
|
605
606
|
userId?: string | undefined;
|
|
606
607
|
} & {
|
|
607
608
|
fetchOptions?: FetchOptions | undefined;
|
|
608
|
-
}>, data_1?: FetchOptions | undefined) => Promise<import("
|
|
609
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/client").BetterFetchResponse<{
|
|
609
610
|
accessToken: string | undefined;
|
|
610
611
|
refreshToken: string | undefined;
|
|
611
612
|
accessTokenExpiresAt: Date | undefined;
|
|
@@ -623,13 +624,13 @@ export declare function initAuth(config: InitAuthConfig): {
|
|
|
623
624
|
providerId: string;
|
|
624
625
|
accountId?: string | undefined;
|
|
625
626
|
userId?: string | undefined;
|
|
626
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth
|
|
627
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
|
|
627
628
|
providerId: string;
|
|
628
629
|
accountId?: string | undefined;
|
|
629
630
|
userId?: string | undefined;
|
|
630
631
|
} & {
|
|
631
632
|
fetchOptions?: FetchOptions | undefined;
|
|
632
|
-
}>, data_1?: FetchOptions | undefined) => Promise<import("
|
|
633
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/client").BetterFetchResponse<{
|
|
633
634
|
accessToken: string;
|
|
634
635
|
accessTokenExpiresAt: Date | undefined;
|
|
635
636
|
scopes: string[];
|
|
@@ -641,12 +642,12 @@ export declare function initAuth(config: InitAuthConfig): {
|
|
|
641
642
|
} & {
|
|
642
643
|
accountInfo: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<{
|
|
643
644
|
accountId?: string | undefined;
|
|
644
|
-
}> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth
|
|
645
|
+
}> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth").Prettify<{
|
|
645
646
|
query?: {
|
|
646
647
|
accountId?: string | undefined;
|
|
647
648
|
} | undefined;
|
|
648
649
|
fetchOptions?: FetchOptions | undefined;
|
|
649
|
-
}> | undefined, data_1?: FetchOptions | undefined) => Promise<import("
|
|
650
|
+
}> | undefined, data_1?: FetchOptions | undefined) => Promise<import("better-auth/client").BetterFetchResponse<{
|
|
650
651
|
user: import("better-auth").OAuth2UserInfo;
|
|
651
652
|
data: Record<string, any>;
|
|
652
653
|
}, {
|
|
@@ -657,13 +658,13 @@ export declare function initAuth(config: InitAuthConfig): {
|
|
|
657
658
|
getSession: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<{
|
|
658
659
|
disableCookieCache?: unknown;
|
|
659
660
|
disableRefresh?: unknown;
|
|
660
|
-
}> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth
|
|
661
|
+
}> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth").Prettify<{
|
|
661
662
|
query?: {
|
|
662
663
|
disableCookieCache?: unknown;
|
|
663
664
|
disableRefresh?: unknown;
|
|
664
665
|
} | undefined;
|
|
665
666
|
fetchOptions?: FetchOptions | undefined;
|
|
666
|
-
}> | undefined, data_1?: FetchOptions | undefined) => Promise<import("
|
|
667
|
+
}> | undefined, data_1?: FetchOptions | undefined) => Promise<import("better-auth/client").BetterFetchResponse<{
|
|
667
668
|
user: {
|
|
668
669
|
id: string;
|
|
669
670
|
createdAt: Date;
|
|
@@ -712,7 +713,7 @@ export declare function initAuth(config: InitAuthConfig): {
|
|
|
712
713
|
} | null;
|
|
713
714
|
isPending: boolean;
|
|
714
715
|
isRefetching: boolean;
|
|
715
|
-
error: import("
|
|
716
|
+
error: import("better-auth/client").BetterFetchError | null;
|
|
716
717
|
refetch: (queryParams?: {
|
|
717
718
|
query?: import("better-auth").SessionQueryParams;
|
|
718
719
|
} | undefined) => Promise<void>;
|
|
@@ -740,21 +741,21 @@ export declare function initAuth(config: InitAuthConfig): {
|
|
|
740
741
|
};
|
|
741
742
|
};
|
|
742
743
|
};
|
|
743
|
-
$fetch: import("
|
|
744
|
-
plugins: (import("
|
|
744
|
+
$fetch: import("better-auth/client").BetterFetch<{
|
|
745
|
+
plugins: (import("better-auth/client").BetterFetchPlugin<Record<string, any>> | {
|
|
745
746
|
id: string;
|
|
746
747
|
name: string;
|
|
747
748
|
hooks: {
|
|
748
|
-
onSuccess(context: import("
|
|
749
|
+
onSuccess(context: import("better-auth/client").SuccessContext<any>): void;
|
|
749
750
|
};
|
|
750
751
|
} | {
|
|
751
752
|
id: string;
|
|
752
753
|
name: string;
|
|
753
754
|
hooks: {
|
|
754
|
-
onSuccess: ((context: import("
|
|
755
|
-
onError: ((context: import("
|
|
756
|
-
onRequest: (<T extends Record<string, any>>(context: import("
|
|
757
|
-
onResponse: ((context: import("
|
|
755
|
+
onSuccess: ((context: import("better-auth/client").SuccessContext<any>) => Promise<void> | void) | undefined;
|
|
756
|
+
onError: ((context: import("better-auth/client").ErrorContext) => Promise<void> | void) | undefined;
|
|
757
|
+
onRequest: (<T extends Record<string, any>>(context: import("better-auth/client").RequestContext<T>) => Promise<import("better-auth/client").RequestContext | void> | import("better-auth/client").RequestContext | void) | undefined;
|
|
758
|
+
onResponse: ((context: import("better-auth/client").ResponseContext) => Promise<Response | void | import("better-auth/client").ResponseContext> | Response | import("better-auth/client").ResponseContext | void) | undefined;
|
|
758
759
|
};
|
|
759
760
|
})[];
|
|
760
761
|
cache?: RequestCache | undefined;
|
|
@@ -774,12 +775,12 @@ export declare function initAuth(config: InitAuthConfig): {
|
|
|
774
775
|
referrerPolicy?: ReferrerPolicy | undefined;
|
|
775
776
|
signal?: (AbortSignal | null) | undefined;
|
|
776
777
|
window?: null | undefined;
|
|
777
|
-
onRetry?: ((response: import("
|
|
778
|
+
onRetry?: ((response: import("better-auth/client").ResponseContext) => Promise<void> | void) | undefined;
|
|
778
779
|
hookOptions?: {
|
|
779
780
|
cloneResponse?: boolean;
|
|
780
781
|
} | undefined;
|
|
781
782
|
timeout?: number | undefined;
|
|
782
|
-
customFetchImpl: import("
|
|
783
|
+
customFetchImpl: import("better-auth/client").FetchEsque;
|
|
783
784
|
baseURL: string;
|
|
784
785
|
throw?: boolean | undefined;
|
|
785
786
|
auth?: ({
|
|
@@ -799,20 +800,62 @@ export declare function initAuth(config: InitAuthConfig): {
|
|
|
799
800
|
params?: any;
|
|
800
801
|
duplex?: "full" | "half" | undefined;
|
|
801
802
|
jsonParser: (text: string) => Promise<any> | any;
|
|
802
|
-
retry?: import("
|
|
803
|
+
retry?: import("better-auth/client").RetryOptions | undefined;
|
|
803
804
|
retryAttempt?: number | undefined;
|
|
804
|
-
output?: (import("
|
|
805
|
-
errorSchema?: import("
|
|
805
|
+
output?: (import("better-auth/client").StandardSchemaV1 | typeof Blob | typeof File) | undefined;
|
|
806
|
+
errorSchema?: import("better-auth/client").StandardSchemaV1 | undefined;
|
|
806
807
|
disableValidation?: boolean | undefined;
|
|
807
808
|
disableSignal?: boolean | undefined;
|
|
808
809
|
}, unknown, unknown, {}>;
|
|
809
810
|
$store: {
|
|
810
811
|
notify: (signal?: (Omit<string, "$sessionSignal"> | "$sessionSignal") | undefined) => void;
|
|
811
812
|
listen: (signal: Omit<string, "$sessionSignal"> | "$sessionSignal", listener: (value: boolean, oldValue?: boolean | undefined) => void) => void;
|
|
812
|
-
atoms: Record<string, import("
|
|
813
|
+
atoms: Record<string, import("better-auth/client").WritableAtom<any>>;
|
|
813
814
|
};
|
|
814
815
|
$ERROR_CODES: {
|
|
815
|
-
|
|
816
|
+
readonly USER_NOT_FOUND: "User not found";
|
|
817
|
+
readonly FAILED_TO_CREATE_USER: "Failed to create user";
|
|
818
|
+
readonly FAILED_TO_CREATE_SESSION: "Failed to create session";
|
|
819
|
+
readonly FAILED_TO_UPDATE_USER: "Failed to update user";
|
|
820
|
+
readonly FAILED_TO_GET_SESSION: "Failed to get session";
|
|
821
|
+
readonly INVALID_PASSWORD: "Invalid password";
|
|
822
|
+
readonly INVALID_EMAIL: "Invalid email";
|
|
823
|
+
readonly INVALID_EMAIL_OR_PASSWORD: "Invalid email or password";
|
|
824
|
+
readonly SOCIAL_ACCOUNT_ALREADY_LINKED: "Social account already linked";
|
|
825
|
+
readonly PROVIDER_NOT_FOUND: "Provider not found";
|
|
826
|
+
readonly INVALID_TOKEN: "Invalid token";
|
|
827
|
+
readonly ID_TOKEN_NOT_SUPPORTED: "id_token not supported";
|
|
828
|
+
readonly FAILED_TO_GET_USER_INFO: "Failed to get user info";
|
|
829
|
+
readonly USER_EMAIL_NOT_FOUND: "User email not found";
|
|
830
|
+
readonly EMAIL_NOT_VERIFIED: "Email not verified";
|
|
831
|
+
readonly PASSWORD_TOO_SHORT: "Password too short";
|
|
832
|
+
readonly PASSWORD_TOO_LONG: "Password too long";
|
|
833
|
+
readonly USER_ALREADY_EXISTS: "User already exists.";
|
|
834
|
+
readonly USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL: "User already exists. Use another email.";
|
|
835
|
+
readonly EMAIL_CAN_NOT_BE_UPDATED: "Email can not be updated";
|
|
836
|
+
readonly CREDENTIAL_ACCOUNT_NOT_FOUND: "Credential account not found";
|
|
837
|
+
readonly SESSION_EXPIRED: "Session expired. Re-authenticate to perform this action.";
|
|
838
|
+
readonly FAILED_TO_UNLINK_LAST_ACCOUNT: "You can't unlink your last account";
|
|
839
|
+
readonly ACCOUNT_NOT_FOUND: "Account not found";
|
|
840
|
+
readonly USER_ALREADY_HAS_PASSWORD: "User already has a password. Provide that to delete the account.";
|
|
841
|
+
readonly CROSS_SITE_NAVIGATION_LOGIN_BLOCKED: "Cross-site navigation login blocked. This request appears to be a CSRF attack.";
|
|
842
|
+
readonly VERIFICATION_EMAIL_NOT_ENABLED: "Verification email isn't enabled";
|
|
843
|
+
readonly EMAIL_ALREADY_VERIFIED: "Email is already verified";
|
|
844
|
+
readonly EMAIL_MISMATCH: "Email mismatch";
|
|
845
|
+
readonly SESSION_NOT_FRESH: "Session is not fresh";
|
|
846
|
+
readonly LINKED_ACCOUNT_ALREADY_EXISTS: "Linked account already exists";
|
|
847
|
+
readonly INVALID_ORIGIN: "Invalid origin";
|
|
848
|
+
readonly INVALID_CALLBACK_URL: "Invalid callbackURL";
|
|
849
|
+
readonly INVALID_REDIRECT_URL: "Invalid redirectURL";
|
|
850
|
+
readonly INVALID_ERROR_CALLBACK_URL: "Invalid errorCallbackURL";
|
|
851
|
+
readonly INVALID_NEW_USER_CALLBACK_URL: "Invalid newUserCallbackURL";
|
|
852
|
+
readonly MISSING_OR_NULL_ORIGIN: "Missing or null Origin";
|
|
853
|
+
readonly CALLBACK_URL_REQUIRED: "callbackURL is required";
|
|
854
|
+
readonly FAILED_TO_CREATE_VERIFICATION: "Unable to create verification";
|
|
855
|
+
readonly FIELD_NOT_ALLOWED: "Field not allowed to be set";
|
|
856
|
+
readonly ASYNC_VALIDATION_NOT_SUPPORTED: "Async validation is not supported";
|
|
857
|
+
readonly VALIDATION_ERROR: "Validation Error";
|
|
858
|
+
readonly MISSING_FIELD: "Field is required";
|
|
816
859
|
};
|
|
817
860
|
};
|
|
818
861
|
getCurrentUser: () => import("./types").SessionUser | null;
|
package/dist/init.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../src/init.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAGzC;;GAEG;AACH,UAAU,cAAc;IACtB,6BAA6B;IAC7B,OAAO,EAAE,MAAM,CAAA;IACf,qDAAqD;IACrD,OAAO,CAAC,EAAE,UAAU,CAAC,SAAS,CAAC,CAAA;IAC/B,6BAA6B;IAC7B,uBAAuB,CAAC,EAAE,OAAO,CAAA;IACjC,iCAAiC;IACjC,eAAe,CAAC,EAAE,MAAM,CAAA;CACzB;AAED;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAgBypH,CAAC;;;;yBAAitE,CAAC
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../src/init.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAGzC;;GAEG;AACH,UAAU,cAAc;IACtB,6BAA6B;IAC7B,OAAO,EAAE,MAAM,CAAA;IACf,qDAAqD;IACrD,OAAO,CAAC,EAAE,UAAU,CAAC,SAAS,CAAC,CAAA;IAC/B,6BAA6B;IAC7B,uBAAuB,CAAC,EAAE,OAAO,CAAA;IACjC,iCAAiC;IACjC,eAAe,CAAC,EAAE,MAAM,CAAA;CACzB;AAED;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAgBypH,CAAC;;;;yBAAitE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAA5nK,CAAC;qBAAe,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAi4C,CAAC;;mBAA2D,CAAC;;;;;oBAA8U,CAAC;uBAA8C,CAAC;qBAAmC,CAAC;qBAAmC,CAAC;gBAA+B,CAAC;oBAAuC,CAAC;oBAA2C,CAAC;0BAAwC,CAAC;kBAAwC,CAAC;kBAA8C,CAAC;mBAA+B,CAAC;uBAA0G,CAAC;6BAAuB,CAAC;;mBAAyC,CAAC;;;iBAA2G,CAAC;gBAA+B,CAAC;;;;;;;;;;;;gBAA+e,CAAC;iBAAgB,CAAC;kBAAiB,CAAC;kBAAiB,CAAC;;iBAA8F,CAAC;wBAAkE,CAAC;kBAAgC,CAAC;uBAAmG,CAAC;6BAA2E,CAAC;yBAAwC,CAAC;;;2BAAkF,CAAC;mHAAuL,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAD78I"}
|