@payez/next-mvp 4.1.20 → 4.1.21
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.
|
@@ -24,7 +24,7 @@ export declare const authClient: {
|
|
|
24
24
|
metadata?: Record<string, any> | undefined;
|
|
25
25
|
} & {
|
|
26
26
|
fetchOptions?: FetchOptions | undefined;
|
|
27
|
-
}>, data_1?: FetchOptions | undefined) => Promise<import("
|
|
27
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<{
|
|
28
28
|
status: boolean;
|
|
29
29
|
}, {
|
|
30
30
|
code?: string | undefined;
|
|
@@ -46,7 +46,7 @@ export declare const authClient: {
|
|
|
46
46
|
newUserCallbackURL?: string | undefined;
|
|
47
47
|
};
|
|
48
48
|
fetchOptions?: FetchOptions | undefined;
|
|
49
|
-
}>, data_1?: FetchOptions | undefined) => Promise<import("
|
|
49
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<Omit<{
|
|
50
50
|
token: string;
|
|
51
51
|
user: {
|
|
52
52
|
id: string;
|
|
@@ -124,7 +124,7 @@ export declare const authClient: {
|
|
|
124
124
|
additionalData?: Record<string, any> | undefined;
|
|
125
125
|
} & {
|
|
126
126
|
fetchOptions?: FetchOptions | undefined;
|
|
127
|
-
}>, data_1?: FetchOptions | undefined) => Promise<import("
|
|
127
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<{
|
|
128
128
|
redirect: boolean;
|
|
129
129
|
url: string;
|
|
130
130
|
} | (Omit<{
|
|
@@ -159,7 +159,7 @@ export declare const authClient: {
|
|
|
159
159
|
signOut: <FetchOptions extends import("@better-auth/core").ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth/react").Prettify<{
|
|
160
160
|
query?: Record<string, any> | undefined;
|
|
161
161
|
fetchOptions?: FetchOptions | undefined;
|
|
162
|
-
}> | undefined, data_1?: FetchOptions | undefined) => Promise<import("
|
|
162
|
+
}> | undefined, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<{
|
|
163
163
|
success: boolean;
|
|
164
164
|
}, {
|
|
165
165
|
code?: string | undefined;
|
|
@@ -181,7 +181,7 @@ export declare const authClient: {
|
|
|
181
181
|
image?: string | undefined;
|
|
182
182
|
callbackURL?: string | undefined;
|
|
183
183
|
fetchOptions?: FetchOptions | undefined;
|
|
184
|
-
}>, data_1?: FetchOptions | undefined) => Promise<import("
|
|
184
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<(Omit<{
|
|
185
185
|
token: null;
|
|
186
186
|
user: {
|
|
187
187
|
id: string;
|
|
@@ -242,7 +242,7 @@ export declare const authClient: {
|
|
|
242
242
|
rememberMe?: boolean | undefined;
|
|
243
243
|
} & {
|
|
244
244
|
fetchOptions?: FetchOptions | undefined;
|
|
245
|
-
}>, data_1?: FetchOptions | undefined) => Promise<import("
|
|
245
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<Omit<{
|
|
246
246
|
redirect: boolean;
|
|
247
247
|
token: string;
|
|
248
248
|
url?: string | undefined;
|
|
@@ -281,7 +281,7 @@ export declare const authClient: {
|
|
|
281
281
|
token?: string | undefined;
|
|
282
282
|
} & {
|
|
283
283
|
fetchOptions?: FetchOptions | undefined;
|
|
284
|
-
}>, data_1?: FetchOptions | undefined) => Promise<import("
|
|
284
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<{
|
|
285
285
|
status: boolean;
|
|
286
286
|
}, {
|
|
287
287
|
code?: string | undefined;
|
|
@@ -297,7 +297,7 @@ export declare const authClient: {
|
|
|
297
297
|
callbackURL?: string | undefined;
|
|
298
298
|
};
|
|
299
299
|
fetchOptions?: FetchOptions | undefined;
|
|
300
|
-
}>, data_1?: FetchOptions | undefined) => Promise<import("
|
|
300
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<NonNullable<void | {
|
|
301
301
|
status: boolean;
|
|
302
302
|
}>, {
|
|
303
303
|
code?: string | undefined;
|
|
@@ -312,7 +312,7 @@ export declare const authClient: {
|
|
|
312
312
|
callbackURL?: string | undefined;
|
|
313
313
|
} & {
|
|
314
314
|
fetchOptions?: FetchOptions | undefined;
|
|
315
|
-
}>, data_1?: FetchOptions | undefined) => Promise<import("
|
|
315
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<{
|
|
316
316
|
status: boolean;
|
|
317
317
|
}, {
|
|
318
318
|
code?: string | undefined;
|
|
@@ -327,7 +327,7 @@ export declare const authClient: {
|
|
|
327
327
|
callbackURL?: string | undefined;
|
|
328
328
|
} & {
|
|
329
329
|
fetchOptions?: FetchOptions | undefined;
|
|
330
|
-
}>, data_1?: FetchOptions | undefined) => Promise<import("
|
|
330
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<{
|
|
331
331
|
status: boolean;
|
|
332
332
|
}, {
|
|
333
333
|
code?: string | undefined;
|
|
@@ -344,7 +344,7 @@ export declare const authClient: {
|
|
|
344
344
|
revokeOtherSessions?: boolean | undefined;
|
|
345
345
|
} & {
|
|
346
346
|
fetchOptions?: FetchOptions | undefined;
|
|
347
|
-
}>, data_1?: FetchOptions | undefined) => Promise<import("
|
|
347
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<Omit<{
|
|
348
348
|
token: string | null;
|
|
349
349
|
user: {
|
|
350
350
|
id: string;
|
|
@@ -380,7 +380,7 @@ export declare const authClient: {
|
|
|
380
380
|
} & {
|
|
381
381
|
updateSession: <FetchOptions extends import("@better-auth/core").ClientFetchOption<Partial<Partial<{}>> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth/react").Prettify<Partial<{}> & {
|
|
382
382
|
fetchOptions?: FetchOptions | undefined;
|
|
383
|
-
}> | undefined, data_1?: FetchOptions | undefined) => Promise<import("
|
|
383
|
+
}> | undefined, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<{
|
|
384
384
|
session: {
|
|
385
385
|
id: string;
|
|
386
386
|
createdAt: Date;
|
|
@@ -405,16 +405,16 @@ export declare const authClient: {
|
|
|
405
405
|
$InferServerPlugin: ReturnType<(options: import("better-auth/plugins/magic-link").MagicLinkOptions) => {
|
|
406
406
|
id: "magic-link";
|
|
407
407
|
endpoints: {
|
|
408
|
-
signInMagicLink: import("better-
|
|
408
|
+
signInMagicLink: import("better-auth/*").StrictEndpoint<"/sign-in/magic-link", {
|
|
409
409
|
method: "POST";
|
|
410
410
|
requireHeaders: true;
|
|
411
|
-
body: import("
|
|
412
|
-
email: import("
|
|
413
|
-
name: import("
|
|
414
|
-
callbackURL: import("
|
|
415
|
-
newUserCallbackURL: import("
|
|
416
|
-
errorCallbackURL: import("
|
|
417
|
-
metadata: import("
|
|
411
|
+
body: import("better-auth/*").ZodObject<{
|
|
412
|
+
email: import("better-auth/*").ZodEmail;
|
|
413
|
+
name: import("better-auth/*").ZodOptional<import("better-auth/*").ZodString>;
|
|
414
|
+
callbackURL: import("better-auth/*").ZodOptional<import("better-auth/*").ZodString>;
|
|
415
|
+
newUserCallbackURL: import("better-auth/*").ZodOptional<import("better-auth/*").ZodString>;
|
|
416
|
+
errorCallbackURL: import("better-auth/*").ZodOptional<import("better-auth/*").ZodString>;
|
|
417
|
+
metadata: import("better-auth/*").ZodOptional<import("better-auth/*").ZodRecord<import("better-auth/*").ZodString, import("better-auth/*").ZodAny>>;
|
|
418
418
|
}, import("better-auth/*").$strip>;
|
|
419
419
|
metadata: {
|
|
420
420
|
openapi: {
|
|
@@ -442,15 +442,15 @@ export declare const authClient: {
|
|
|
442
442
|
}, {
|
|
443
443
|
status: boolean;
|
|
444
444
|
}>;
|
|
445
|
-
magicLinkVerify: import("better-
|
|
445
|
+
magicLinkVerify: import("better-auth/*").StrictEndpoint<"/magic-link/verify", {
|
|
446
446
|
method: "GET";
|
|
447
|
-
query: import("
|
|
448
|
-
token: import("
|
|
449
|
-
callbackURL: import("
|
|
450
|
-
errorCallbackURL: import("
|
|
451
|
-
newUserCallbackURL: import("
|
|
447
|
+
query: import("better-auth/*").ZodObject<{
|
|
448
|
+
token: import("better-auth/*").ZodString;
|
|
449
|
+
callbackURL: import("better-auth/*").ZodOptional<import("better-auth/*").ZodString>;
|
|
450
|
+
errorCallbackURL: import("better-auth/*").ZodOptional<import("better-auth/*").ZodString>;
|
|
451
|
+
newUserCallbackURL: import("better-auth/*").ZodOptional<import("better-auth/*").ZodString>;
|
|
452
452
|
}, import("better-auth/*").$strip>;
|
|
453
|
-
use: ((inputContext: import("better-
|
|
453
|
+
use: ((inputContext: import("better-auth/*").MiddlewareInputContext<import("better-auth/*").MiddlewareOptions>) => Promise<void>)[];
|
|
454
454
|
requireHeaders: true;
|
|
455
455
|
metadata: {
|
|
456
456
|
openapi: {
|
|
@@ -499,7 +499,7 @@ export declare const authClient: {
|
|
|
499
499
|
options: import("better-auth/plugins/magic-link").MagicLinkOptions;
|
|
500
500
|
}>;
|
|
501
501
|
}[];
|
|
502
|
-
}, FetchOptions>> | undefined, data_1?: FetchOptions | undefined) => Promise<import("
|
|
502
|
+
}, FetchOptions>> | undefined, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<{
|
|
503
503
|
status: boolean;
|
|
504
504
|
}, {
|
|
505
505
|
code?: string | undefined;
|
|
@@ -516,7 +516,7 @@ export declare const authClient: {
|
|
|
516
516
|
token?: string | undefined;
|
|
517
517
|
} & {
|
|
518
518
|
fetchOptions?: FetchOptions | undefined;
|
|
519
|
-
}> | undefined, data_1?: FetchOptions | undefined) => Promise<import("
|
|
519
|
+
}> | undefined, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<{
|
|
520
520
|
success: boolean;
|
|
521
521
|
message: string;
|
|
522
522
|
}, {
|
|
@@ -532,7 +532,7 @@ export declare const authClient: {
|
|
|
532
532
|
redirectTo?: string | undefined;
|
|
533
533
|
} & {
|
|
534
534
|
fetchOptions?: FetchOptions | undefined;
|
|
535
|
-
}>, data_1?: FetchOptions | undefined) => Promise<import("
|
|
535
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<{
|
|
536
536
|
status: boolean;
|
|
537
537
|
message: string;
|
|
538
538
|
}, {
|
|
@@ -550,7 +550,7 @@ export declare const authClient: {
|
|
|
550
550
|
callbackURL: string;
|
|
551
551
|
};
|
|
552
552
|
fetchOptions?: FetchOptions | undefined;
|
|
553
|
-
}>, data_1?: FetchOptions | undefined) => Promise<import("
|
|
553
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<never, {
|
|
554
554
|
code?: string | undefined;
|
|
555
555
|
message?: string | undefined;
|
|
556
556
|
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
@@ -559,7 +559,7 @@ export declare const authClient: {
|
|
|
559
559
|
listSessions: <FetchOptions extends import("@better-auth/core").ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth/react").Prettify<{
|
|
560
560
|
query?: Record<string, any> | undefined;
|
|
561
561
|
fetchOptions?: FetchOptions | undefined;
|
|
562
|
-
}> | undefined, data_1?: FetchOptions | undefined) => Promise<import("
|
|
562
|
+
}> | undefined, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<import("better-auth/react").Prettify<{
|
|
563
563
|
id: string;
|
|
564
564
|
createdAt: Date;
|
|
565
565
|
updatedAt: Date;
|
|
@@ -579,7 +579,7 @@ export declare const authClient: {
|
|
|
579
579
|
token: string;
|
|
580
580
|
} & {
|
|
581
581
|
fetchOptions?: FetchOptions | undefined;
|
|
582
|
-
}>, data_1?: FetchOptions | undefined) => Promise<import("
|
|
582
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<{
|
|
583
583
|
status: boolean;
|
|
584
584
|
}, {
|
|
585
585
|
code?: string | undefined;
|
|
@@ -589,7 +589,7 @@ export declare const authClient: {
|
|
|
589
589
|
revokeSessions: <FetchOptions extends import("@better-auth/core").ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth/react").Prettify<{
|
|
590
590
|
query?: Record<string, any> | undefined;
|
|
591
591
|
fetchOptions?: FetchOptions | undefined;
|
|
592
|
-
}> | undefined, data_1?: FetchOptions | undefined) => Promise<import("
|
|
592
|
+
}> | undefined, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<{
|
|
593
593
|
status: boolean;
|
|
594
594
|
}, {
|
|
595
595
|
code?: string | undefined;
|
|
@@ -599,7 +599,7 @@ export declare const authClient: {
|
|
|
599
599
|
revokeOtherSessions: <FetchOptions extends import("@better-auth/core").ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth/react").Prettify<{
|
|
600
600
|
query?: Record<string, any> | undefined;
|
|
601
601
|
fetchOptions?: FetchOptions | undefined;
|
|
602
|
-
}> | undefined, data_1?: FetchOptions | undefined) => Promise<import("
|
|
602
|
+
}> | undefined, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<{
|
|
603
603
|
status: boolean;
|
|
604
604
|
}, {
|
|
605
605
|
code?: string | undefined;
|
|
@@ -638,7 +638,7 @@ export declare const authClient: {
|
|
|
638
638
|
additionalData?: Record<string, any> | undefined;
|
|
639
639
|
} & {
|
|
640
640
|
fetchOptions?: FetchOptions | undefined;
|
|
641
|
-
}>, data_1?: FetchOptions | undefined) => Promise<import("
|
|
641
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<{
|
|
642
642
|
url: string;
|
|
643
643
|
redirect: boolean;
|
|
644
644
|
}, {
|
|
@@ -649,7 +649,7 @@ export declare const authClient: {
|
|
|
649
649
|
listAccounts: <FetchOptions extends import("@better-auth/core").ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth/react").Prettify<{
|
|
650
650
|
query?: Record<string, any> | undefined;
|
|
651
651
|
fetchOptions?: FetchOptions | undefined;
|
|
652
|
-
}> | undefined, data_1?: FetchOptions | undefined) => Promise<import("
|
|
652
|
+
}> | undefined, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<{
|
|
653
653
|
scopes: string[];
|
|
654
654
|
id: string;
|
|
655
655
|
createdAt: Date;
|
|
@@ -672,7 +672,7 @@ export declare const authClient: {
|
|
|
672
672
|
callbackURL?: string | undefined;
|
|
673
673
|
};
|
|
674
674
|
fetchOptions?: FetchOptions | undefined;
|
|
675
|
-
}>, data_1?: FetchOptions | undefined) => Promise<import("
|
|
675
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<{
|
|
676
676
|
success: boolean;
|
|
677
677
|
message: string;
|
|
678
678
|
}, {
|
|
@@ -689,7 +689,7 @@ export declare const authClient: {
|
|
|
689
689
|
accountId?: string | undefined;
|
|
690
690
|
} & {
|
|
691
691
|
fetchOptions?: FetchOptions | undefined;
|
|
692
|
-
}>, data_1?: FetchOptions | undefined) => Promise<import("
|
|
692
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<{
|
|
693
693
|
status: boolean;
|
|
694
694
|
}, {
|
|
695
695
|
code?: string | undefined;
|
|
@@ -706,7 +706,7 @@ export declare const authClient: {
|
|
|
706
706
|
userId?: string | undefined;
|
|
707
707
|
} & {
|
|
708
708
|
fetchOptions?: FetchOptions | undefined;
|
|
709
|
-
}>, data_1?: FetchOptions | undefined) => Promise<import("
|
|
709
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<{
|
|
710
710
|
accessToken: string | undefined;
|
|
711
711
|
refreshToken: string;
|
|
712
712
|
accessTokenExpiresAt: Date | undefined;
|
|
@@ -730,7 +730,7 @@ export declare const authClient: {
|
|
|
730
730
|
userId?: string | undefined;
|
|
731
731
|
} & {
|
|
732
732
|
fetchOptions?: FetchOptions | undefined;
|
|
733
|
-
}>, data_1?: FetchOptions | undefined) => Promise<import("
|
|
733
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<{
|
|
734
734
|
accessToken: string;
|
|
735
735
|
accessTokenExpiresAt: Date | undefined;
|
|
736
736
|
scopes: string[];
|
|
@@ -747,7 +747,7 @@ export declare const authClient: {
|
|
|
747
747
|
accountId?: string | undefined;
|
|
748
748
|
} | undefined;
|
|
749
749
|
fetchOptions?: FetchOptions | undefined;
|
|
750
|
-
}> | undefined, data_1?: FetchOptions | undefined) => Promise<import("
|
|
750
|
+
}> | undefined, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<{
|
|
751
751
|
user: import("better-auth/*").OAuth2UserInfo;
|
|
752
752
|
data: Record<string, any>;
|
|
753
753
|
}, {
|
|
@@ -764,7 +764,7 @@ export declare const authClient: {
|
|
|
764
764
|
disableRefresh?: unknown;
|
|
765
765
|
} | undefined;
|
|
766
766
|
fetchOptions?: FetchOptions | undefined;
|
|
767
|
-
}> | undefined, data_1?: FetchOptions | undefined) => Promise<import("
|
|
767
|
+
}> | undefined, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<{
|
|
768
768
|
user: import("better-auth/react").StripEmptyObjects<{
|
|
769
769
|
id: string;
|
|
770
770
|
createdAt: Date;
|
|
@@ -813,7 +813,7 @@ export declare const authClient: {
|
|
|
813
813
|
} | null;
|
|
814
814
|
isPending: boolean;
|
|
815
815
|
isRefetching: boolean;
|
|
816
|
-
error: import("
|
|
816
|
+
error: import("better-auth/react").BetterFetchError | null;
|
|
817
817
|
refetch: (queryParams
|
|
818
818
|
/**
|
|
819
819
|
* NextAuth-compatible signOut wrapper.
|
|
@@ -847,21 +847,21 @@ export declare const authClient: {
|
|
|
847
847
|
}>;
|
|
848
848
|
};
|
|
849
849
|
};
|
|
850
|
-
$fetch: import("
|
|
851
|
-
plugins: (import("
|
|
850
|
+
$fetch: import("better-auth/react").BetterFetch<{
|
|
851
|
+
plugins: (import("better-auth/react").BetterFetchPlugin<Record<string, any>> | {
|
|
852
852
|
id: string;
|
|
853
853
|
name: string;
|
|
854
854
|
hooks: {
|
|
855
|
-
onSuccess(context: import("
|
|
855
|
+
onSuccess(context: import("better-auth/react").SuccessContext<any>): void;
|
|
856
856
|
};
|
|
857
857
|
} | {
|
|
858
858
|
id: string;
|
|
859
859
|
name: string;
|
|
860
860
|
hooks: {
|
|
861
|
-
onSuccess: ((context: import("
|
|
862
|
-
onError: ((context: import("
|
|
863
|
-
onRequest: (<T extends Record<string, any>>(context: import("
|
|
864
|
-
onResponse: ((context: import("
|
|
861
|
+
onSuccess: ((context: import("better-auth/react").SuccessContext<any>) => Promise<void> | void) | undefined;
|
|
862
|
+
onError: ((context: import("better-auth/react").ErrorContext) => Promise<void> | void) | undefined;
|
|
863
|
+
onRequest: (<T extends Record<string, any>>(context: import("better-auth/react").RequestContext<T>) => Promise<import("better-auth/react").RequestContext | void> | import("better-auth/react").RequestContext | void) | undefined;
|
|
864
|
+
onResponse: ((context: import("better-auth/react").ResponseContext) => Promise<Response | void | import("better-auth/react").ResponseContext> | Response | import("better-auth/react").ResponseContext | void) | undefined;
|
|
865
865
|
};
|
|
866
866
|
})[];
|
|
867
867
|
cache?: RequestCache | undefined;
|
|
@@ -881,12 +881,12 @@ export declare const authClient: {
|
|
|
881
881
|
referrerPolicy?: ReferrerPolicy | undefined;
|
|
882
882
|
signal?: (AbortSignal | null) | undefined;
|
|
883
883
|
window?: null | undefined;
|
|
884
|
-
onRetry?: ((response: import("
|
|
884
|
+
onRetry?: ((response: import("better-auth/react").ResponseContext) => Promise<void> | void) | undefined;
|
|
885
885
|
hookOptions?: {
|
|
886
886
|
cloneResponse?: boolean;
|
|
887
887
|
} | undefined;
|
|
888
888
|
timeout?: number | undefined;
|
|
889
|
-
customFetchImpl: import("
|
|
889
|
+
customFetchImpl: import("better-auth/react").FetchEsque;
|
|
890
890
|
baseURL: string;
|
|
891
891
|
throw?: boolean | undefined;
|
|
892
892
|
auth?: ({
|
|
@@ -906,17 +906,17 @@ export declare const authClient: {
|
|
|
906
906
|
params?: any;
|
|
907
907
|
duplex?: "full" | "half" | undefined;
|
|
908
908
|
jsonParser: (text: string) => Promise<any> | any;
|
|
909
|
-
retry?: import("
|
|
909
|
+
retry?: import("better-auth/react").RetryOptions | undefined;
|
|
910
910
|
retryAttempt?: number | undefined;
|
|
911
|
-
output?: (import("
|
|
912
|
-
errorSchema?: import("
|
|
911
|
+
output?: (import("better-auth/react").StandardSchemaV1 | typeof Blob | typeof File) | undefined;
|
|
912
|
+
errorSchema?: import("better-auth/react").StandardSchemaV1 | undefined;
|
|
913
913
|
disableValidation?: boolean | undefined;
|
|
914
914
|
disableSignal?: boolean | undefined;
|
|
915
915
|
}, unknown, unknown, {}>;
|
|
916
916
|
$store: {
|
|
917
917
|
notify: (signal?: (Omit<string, "$sessionSignal"> | "$sessionSignal") | undefined) => void;
|
|
918
918
|
listen: (signal: Omit<string, "$sessionSignal"> | "$sessionSignal", listener: (value: boolean, oldValue?: boolean | undefined) => void) => void;
|
|
919
|
-
atoms: Record<string, import("
|
|
919
|
+
atoms: Record<string, import("better-auth/react").WritableAtom<any>>;
|
|
920
920
|
};
|
|
921
921
|
$ERROR_CODES: {
|
|
922
922
|
USER_NOT_FOUND: import("better-auth/*").RawError<"USER_NOT_FOUND">;
|
|
@@ -993,7 +993,7 @@ export declare const useSession: () => {
|
|
|
993
993
|
} | null;
|
|
994
994
|
isPending: boolean;
|
|
995
995
|
isRefetching: boolean;
|
|
996
|
-
error: import("
|
|
996
|
+
error: import("better-auth/react").BetterFetchError | null;
|
|
997
997
|
refetch: (queryParams
|
|
998
998
|
/**
|
|
999
999
|
* NextAuth-compatible signOut wrapper.
|
|
@@ -1020,7 +1020,7 @@ export declare const useSession: () => {
|
|
|
1020
1020
|
metadata?: Record<string, any> | undefined;
|
|
1021
1021
|
} & {
|
|
1022
1022
|
fetchOptions?: FetchOptions | undefined;
|
|
1023
|
-
}>, data_1?: FetchOptions | undefined) => Promise<import("
|
|
1023
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<{
|
|
1024
1024
|
status: boolean;
|
|
1025
1025
|
}, {
|
|
1026
1026
|
code?: string | undefined;
|
|
@@ -1077,7 +1077,7 @@ export declare const useSession: () => {
|
|
|
1077
1077
|
additionalData?: Record<string, any> | undefined;
|
|
1078
1078
|
} & {
|
|
1079
1079
|
fetchOptions?: FetchOptions | undefined;
|
|
1080
|
-
}>, data_1?: FetchOptions | undefined) => Promise<import("
|
|
1080
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<{
|
|
1081
1081
|
redirect: boolean;
|
|
1082
1082
|
url: string;
|
|
1083
1083
|
} | (Omit<{
|
|
@@ -1120,7 +1120,7 @@ export declare const useSession: () => {
|
|
|
1120
1120
|
rememberMe?: boolean | undefined;
|
|
1121
1121
|
} & {
|
|
1122
1122
|
fetchOptions?: FetchOptions | undefined;
|
|
1123
|
-
}>, data_1?: FetchOptions | undefined) => Promise<import("
|
|
1123
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<Omit<{
|
|
1124
1124
|
redirect: boolean;
|
|
1125
1125
|
token: string;
|
|
1126
1126
|
url?: string | undefined;
|
|
@@ -1150,7 +1150,7 @@ export declare const useSession: () => {
|
|
|
1150
1150
|
}, signOut: <FetchOptions extends import("@better-auth/core").ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth/react").Prettify<{
|
|
1151
1151
|
query?: Record<string, any> | undefined;
|
|
1152
1152
|
fetchOptions?: FetchOptions | undefined;
|
|
1153
|
-
}> | undefined, data_1?: FetchOptions | undefined) => Promise<import("
|
|
1153
|
+
}> | undefined, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<{
|
|
1154
1154
|
success: boolean;
|
|
1155
1155
|
}, {
|
|
1156
1156
|
code?: string | undefined;
|
|
@@ -50,6 +50,13 @@ async function ensureFreshAccessToken(sessionToken, config, options = {}) {
|
|
|
50
50
|
}
|
|
51
51
|
const storedToken = session.idpAccessToken;
|
|
52
52
|
if (!storedToken) {
|
|
53
|
+
// Card 187871: same conflation as getIdpToken (server/auth.ts) - a live
|
|
54
|
+
// session with no access token and mfaVerified !== true is a user
|
|
55
|
+
// mid-2FA, not dead. Only terminal once the session itself claims 2FA
|
|
56
|
+
// is already done.
|
|
57
|
+
if (session.mfaVerified !== true) {
|
|
58
|
+
return { ok: false, code: 'NO_TOKEN_PENDING_2FA', message: 'Two-factor authentication required', status: 401, terminal: false };
|
|
59
|
+
}
|
|
53
60
|
return { ok: false, code: 'NO_TOKEN', message: 'No IDP access token in session', status: 401, terminal: true };
|
|
54
61
|
}
|
|
55
62
|
const now = Date.now();
|
package/dist/server/auth.d.ts
CHANGED
|
@@ -12,8 +12,17 @@ export type IdpTokenResult = {
|
|
|
12
12
|
sessionData: SessionData;
|
|
13
13
|
} | {
|
|
14
14
|
success: false;
|
|
15
|
-
error: 'NO_SESSION'
|
|
15
|
+
error: 'NO_SESSION';
|
|
16
16
|
terminal: true;
|
|
17
|
+
} | {
|
|
18
|
+
success: false;
|
|
19
|
+
error: 'NO_TOKEN';
|
|
20
|
+
terminal: true;
|
|
21
|
+
} | {
|
|
22
|
+
success: false;
|
|
23
|
+
error: 'NO_TOKEN_PENDING_2FA';
|
|
24
|
+
terminal: false;
|
|
25
|
+
sessionData: SessionData;
|
|
17
26
|
};
|
|
18
27
|
/**
|
|
19
28
|
* Get the initialized Better Auth instance (singleton).
|
|
@@ -48,26 +57,26 @@ export declare function getAuthInstance(): Promise<import("better-auth/types").A
|
|
|
48
57
|
hooks: {
|
|
49
58
|
before: {
|
|
50
59
|
matcher(ctx: import("@better-auth/core").HookEndpointContext): boolean;
|
|
51
|
-
handler: (inputContext: import("better-
|
|
60
|
+
handler: (inputContext: import("better-auth/*").MiddlewareInputContext<import("better-auth/*").MiddlewareOptions>) => Promise<void>;
|
|
52
61
|
}[];
|
|
53
62
|
after: {
|
|
54
63
|
matcher(ctx: import("@better-auth/core").HookEndpointContext): true;
|
|
55
|
-
handler: (inputContext: import("better-
|
|
64
|
+
handler: (inputContext: import("better-auth/*").MiddlewareInputContext<import("better-auth/*").MiddlewareOptions>) => Promise<void>;
|
|
56
65
|
}[];
|
|
57
66
|
};
|
|
58
67
|
}, ...(import("@better-auth/core").BetterAuthPlugin | {
|
|
59
68
|
id: "magic-link";
|
|
60
69
|
endpoints: {
|
|
61
|
-
signInMagicLink: import("better-
|
|
70
|
+
signInMagicLink: import("better-auth/*").StrictEndpoint<"/sign-in/magic-link", {
|
|
62
71
|
method: "POST";
|
|
63
72
|
requireHeaders: true;
|
|
64
|
-
body: import("
|
|
65
|
-
email: import("
|
|
66
|
-
name: import("
|
|
67
|
-
callbackURL: import("
|
|
68
|
-
newUserCallbackURL: import("
|
|
69
|
-
errorCallbackURL: import("
|
|
70
|
-
metadata: import("
|
|
73
|
+
body: import("better-auth/*").ZodObject<{
|
|
74
|
+
email: import("better-auth/*").ZodEmail;
|
|
75
|
+
name: import("better-auth/*").ZodOptional<import("better-auth/*").ZodString>;
|
|
76
|
+
callbackURL: import("better-auth/*").ZodOptional<import("better-auth/*").ZodString>;
|
|
77
|
+
newUserCallbackURL: import("better-auth/*").ZodOptional<import("better-auth/*").ZodString>;
|
|
78
|
+
errorCallbackURL: import("better-auth/*").ZodOptional<import("better-auth/*").ZodString>;
|
|
79
|
+
metadata: import("better-auth/*").ZodOptional<import("better-auth/*").ZodRecord<import("better-auth/*").ZodString, import("better-auth/*").ZodAny>>;
|
|
71
80
|
}, import("better-auth/*").$strip>;
|
|
72
81
|
metadata: {
|
|
73
82
|
openapi: {
|
|
@@ -95,15 +104,15 @@ export declare function getAuthInstance(): Promise<import("better-auth/types").A
|
|
|
95
104
|
}, {
|
|
96
105
|
status: boolean;
|
|
97
106
|
}>;
|
|
98
|
-
magicLinkVerify: import("better-
|
|
107
|
+
magicLinkVerify: import("better-auth/*").StrictEndpoint<"/magic-link/verify", {
|
|
99
108
|
method: "GET";
|
|
100
|
-
query: import("
|
|
101
|
-
token: import("
|
|
102
|
-
callbackURL: import("
|
|
103
|
-
errorCallbackURL: import("
|
|
104
|
-
newUserCallbackURL: import("
|
|
109
|
+
query: import("better-auth/*").ZodObject<{
|
|
110
|
+
token: import("better-auth/*").ZodString;
|
|
111
|
+
callbackURL: import("better-auth/*").ZodOptional<import("better-auth/*").ZodString>;
|
|
112
|
+
errorCallbackURL: import("better-auth/*").ZodOptional<import("better-auth/*").ZodString>;
|
|
113
|
+
newUserCallbackURL: import("better-auth/*").ZodOptional<import("better-auth/*").ZodString>;
|
|
105
114
|
}, import("better-auth/*").$strip>;
|
|
106
|
-
use: ((inputContext: import("better-
|
|
115
|
+
use: ((inputContext: import("better-auth/*").MiddlewareInputContext<import("better-auth/*").MiddlewareOptions>) => Promise<void>)[];
|
|
107
116
|
requireHeaders: true;
|
|
108
117
|
metadata: {
|
|
109
118
|
openapi: {
|
package/dist/server/auth.js
CHANGED
|
@@ -292,6 +292,14 @@ async function getIdpToken(request) {
|
|
|
292
292
|
}
|
|
293
293
|
const accessToken = sessionData.idpAccessToken || sessionData.accessToken;
|
|
294
294
|
if (!accessToken) {
|
|
295
|
+
// Card 187871: a live Better Auth session with no idpAccessToken and
|
|
296
|
+
// mfaVerified !== true is a user mid-2FA, not a dead session - the IDP
|
|
297
|
+
// withholds the full token until 2FA completes (idp-fetch.ts:81/113).
|
|
298
|
+
// Only treat this as terminal once the session itself claims 2FA is
|
|
299
|
+
// already done; a token missing AFTER that is genuinely broken.
|
|
300
|
+
if (sessionData.mfaVerified !== true) {
|
|
301
|
+
return { success: false, error: 'NO_TOKEN_PENDING_2FA', terminal: false, sessionData };
|
|
302
|
+
}
|
|
295
303
|
return { success: false, error: 'NO_TOKEN', terminal: true };
|
|
296
304
|
}
|
|
297
305
|
return {
|
package/package.json
CHANGED
|
@@ -95,6 +95,13 @@ export async function ensureFreshAccessToken(
|
|
|
95
95
|
|
|
96
96
|
const storedToken = session.idpAccessToken;
|
|
97
97
|
if (!storedToken) {
|
|
98
|
+
// Card 187871: same conflation as getIdpToken (server/auth.ts) - a live
|
|
99
|
+
// session with no access token and mfaVerified !== true is a user
|
|
100
|
+
// mid-2FA, not dead. Only terminal once the session itself claims 2FA
|
|
101
|
+
// is already done.
|
|
102
|
+
if (session.mfaVerified !== true) {
|
|
103
|
+
return { ok: false, code: 'NO_TOKEN_PENDING_2FA', message: 'Two-factor authentication required', status: 401, terminal: false };
|
|
104
|
+
}
|
|
98
105
|
return { ok: false, code: 'NO_TOKEN', message: 'No IDP access token in session', status: 401, terminal: true };
|
|
99
106
|
}
|
|
100
107
|
|
package/src/server/auth.ts
CHANGED
|
@@ -20,7 +20,15 @@ let authInitPromise: Promise<ReturnType<typeof createBetterAuthInstance>> | null
|
|
|
20
20
|
|
|
21
21
|
export type IdpTokenResult =
|
|
22
22
|
| { success: true; accessToken: string; sessionData: SessionData }
|
|
23
|
-
| { success: false; error: 'NO_SESSION'
|
|
23
|
+
| { success: false; error: 'NO_SESSION'; terminal: true }
|
|
24
|
+
// Card 187871: a Better Auth session can exist with NO idpAccessToken yet
|
|
25
|
+
// because 2FA is required and not yet completed - the IDP never issued the
|
|
26
|
+
// full token. That is a RECOVERABLE state (route to 2FA), not a dead
|
|
27
|
+
// session. Only collapse it to NO_TOKEN/terminal when the session itself
|
|
28
|
+
// already claims 2FA is done (sessionData.mfaVerified === true) and there is
|
|
29
|
+
// still no token - that combination is genuinely broken.
|
|
30
|
+
| { success: false; error: 'NO_TOKEN'; terminal: true }
|
|
31
|
+
| { success: false; error: 'NO_TOKEN_PENDING_2FA'; terminal: false; sessionData: SessionData };
|
|
24
32
|
|
|
25
33
|
function buildSessionDataFromAuthSession(session: any): SessionData | null {
|
|
26
34
|
const user = session?.user;
|
|
@@ -271,6 +279,14 @@ export async function getIdpToken(request?: Request): Promise<IdpTokenResult> {
|
|
|
271
279
|
|
|
272
280
|
const accessToken = sessionData.idpAccessToken || (sessionData as any).accessToken;
|
|
273
281
|
if (!accessToken) {
|
|
282
|
+
// Card 187871: a live Better Auth session with no idpAccessToken and
|
|
283
|
+
// mfaVerified !== true is a user mid-2FA, not a dead session - the IDP
|
|
284
|
+
// withholds the full token until 2FA completes (idp-fetch.ts:81/113).
|
|
285
|
+
// Only treat this as terminal once the session itself claims 2FA is
|
|
286
|
+
// already done; a token missing AFTER that is genuinely broken.
|
|
287
|
+
if (sessionData.mfaVerified !== true) {
|
|
288
|
+
return { success: false, error: 'NO_TOKEN_PENDING_2FA', terminal: false, sessionData };
|
|
289
|
+
}
|
|
274
290
|
return { success: false, error: 'NO_TOKEN', terminal: true };
|
|
275
291
|
}
|
|
276
292
|
|