@payez/next-mvp 4.1.0 → 4.1.2
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/auth/better-auth.d.ts +3 -0
- package/dist/auth/better-auth.js +22 -1
- package/dist/client/better-auth-client.d.ts +407 -218
- package/dist/client/better-auth-client.js +3 -1
- package/dist/lib/ensure-fresh-access-token.d.ts +30 -0
- package/dist/lib/ensure-fresh-access-token.js +269 -0
- package/dist/lib/session-store.js +24 -21
- package/dist/lib/token-lifecycle.js +2 -0
- package/dist/models/SessionModel.d.ts +3 -0
- package/dist/models/SessionModel.js +3 -0
- package/dist/routes/auth/session.js +1 -1
- package/dist/server/auth.d.ts +59 -0
- package/dist/server/auth.js +156 -16
- package/dist/server/decode-session.js +2 -0
- package/package.json +6 -1
- package/src/auth/better-auth.ts +434 -408
- package/src/client/better-auth-client.ts +2 -0
- package/src/lib/ensure-fresh-access-token.ts +320 -0
- package/src/lib/session-store.ts +692 -689
- package/src/lib/token-lifecycle.ts +470 -468
- package/src/models/SessionModel.ts +264 -258
- package/src/routes/auth/session.ts +166 -166
- package/src/server/auth.ts +272 -78
- package/src/server/decode-session.ts +202 -200
|
@@ -7,6 +7,155 @@
|
|
|
7
7
|
* components written against the legacy hook don't need destructure changes.
|
|
8
8
|
*/
|
|
9
9
|
export declare const authClient: {
|
|
10
|
+
signIn: {
|
|
11
|
+
magicLink: <FetchOptions extends import("@better-auth/core").ClientFetchOption<Partial<{
|
|
12
|
+
email: string;
|
|
13
|
+
name?: string | undefined;
|
|
14
|
+
callbackURL?: string | undefined;
|
|
15
|
+
newUserCallbackURL?: string | undefined;
|
|
16
|
+
errorCallbackURL?: string | undefined;
|
|
17
|
+
metadata?: Record<string, any> | undefined;
|
|
18
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/react").Prettify<{
|
|
19
|
+
email: string;
|
|
20
|
+
name?: string | undefined;
|
|
21
|
+
callbackURL?: string | undefined;
|
|
22
|
+
newUserCallbackURL?: string | undefined;
|
|
23
|
+
errorCallbackURL?: string | undefined;
|
|
24
|
+
metadata?: Record<string, any> | undefined;
|
|
25
|
+
} & {
|
|
26
|
+
fetchOptions?: FetchOptions | undefined;
|
|
27
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
|
|
28
|
+
status: boolean;
|
|
29
|
+
}, {
|
|
30
|
+
code?: string | undefined;
|
|
31
|
+
message?: string | undefined;
|
|
32
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
33
|
+
};
|
|
34
|
+
} & {
|
|
35
|
+
magicLink: {
|
|
36
|
+
verify: <FetchOptions extends import("@better-auth/core").ClientFetchOption<never, Partial<{
|
|
37
|
+
token: string;
|
|
38
|
+
callbackURL?: string | undefined;
|
|
39
|
+
errorCallbackURL?: string | undefined;
|
|
40
|
+
newUserCallbackURL?: string | undefined;
|
|
41
|
+
}> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/react").Prettify<{
|
|
42
|
+
query: {
|
|
43
|
+
token: string;
|
|
44
|
+
callbackURL?: string | undefined;
|
|
45
|
+
errorCallbackURL?: string | undefined;
|
|
46
|
+
newUserCallbackURL?: string | undefined;
|
|
47
|
+
};
|
|
48
|
+
fetchOptions?: FetchOptions | undefined;
|
|
49
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<Omit<{
|
|
50
|
+
token: string;
|
|
51
|
+
user: {
|
|
52
|
+
id: string;
|
|
53
|
+
createdAt: Date;
|
|
54
|
+
updatedAt: Date;
|
|
55
|
+
email: string;
|
|
56
|
+
emailVerified: boolean;
|
|
57
|
+
name: string;
|
|
58
|
+
image?: string | null | undefined;
|
|
59
|
+
};
|
|
60
|
+
}, "user"> & {
|
|
61
|
+
user: import("better-auth/react").StripEmptyObjects<{
|
|
62
|
+
id: string;
|
|
63
|
+
createdAt: Date;
|
|
64
|
+
updatedAt: Date;
|
|
65
|
+
email: string;
|
|
66
|
+
emailVerified: boolean;
|
|
67
|
+
name: string;
|
|
68
|
+
image?: string | null | undefined;
|
|
69
|
+
}>;
|
|
70
|
+
}, {
|
|
71
|
+
code?: string | undefined;
|
|
72
|
+
message?: string | undefined;
|
|
73
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
74
|
+
};
|
|
75
|
+
} & {
|
|
76
|
+
signIn: {
|
|
77
|
+
social: <FetchOptions extends import("@better-auth/core").ClientFetchOption<Partial<{
|
|
78
|
+
provider: (string & {}) | "linear" | "huggingface" | "github" | "apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "railway" | "vercel" | "wechat";
|
|
79
|
+
callbackURL?: string | undefined;
|
|
80
|
+
newUserCallbackURL?: string | undefined;
|
|
81
|
+
errorCallbackURL?: string | undefined;
|
|
82
|
+
disableRedirect?: boolean | undefined;
|
|
83
|
+
idToken?: {
|
|
84
|
+
token: string;
|
|
85
|
+
nonce?: string | undefined;
|
|
86
|
+
accessToken?: string | undefined;
|
|
87
|
+
refreshToken?: string | undefined;
|
|
88
|
+
expiresAt?: number | undefined;
|
|
89
|
+
user?: {
|
|
90
|
+
name?: {
|
|
91
|
+
firstName?: string | undefined;
|
|
92
|
+
lastName?: string | undefined;
|
|
93
|
+
} | undefined;
|
|
94
|
+
email?: string | undefined;
|
|
95
|
+
} | undefined;
|
|
96
|
+
} | undefined;
|
|
97
|
+
scopes?: string[] | undefined;
|
|
98
|
+
requestSignUp?: boolean | undefined;
|
|
99
|
+
loginHint?: string | undefined;
|
|
100
|
+
additionalData?: Record<string, any> | undefined;
|
|
101
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/react").Prettify<{
|
|
102
|
+
provider: (string & {}) | "linear" | "huggingface" | "github" | "apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "railway" | "vercel" | "wechat";
|
|
103
|
+
callbackURL?: string | undefined;
|
|
104
|
+
newUserCallbackURL?: string | undefined;
|
|
105
|
+
errorCallbackURL?: string | undefined;
|
|
106
|
+
disableRedirect?: boolean | undefined;
|
|
107
|
+
idToken?: {
|
|
108
|
+
token: string;
|
|
109
|
+
nonce?: string | undefined;
|
|
110
|
+
accessToken?: string | undefined;
|
|
111
|
+
refreshToken?: string | undefined;
|
|
112
|
+
expiresAt?: number | undefined;
|
|
113
|
+
user?: {
|
|
114
|
+
name?: {
|
|
115
|
+
firstName?: string | undefined;
|
|
116
|
+
lastName?: string | undefined;
|
|
117
|
+
} | undefined;
|
|
118
|
+
email?: string | undefined;
|
|
119
|
+
} | undefined;
|
|
120
|
+
} | undefined;
|
|
121
|
+
scopes?: string[] | undefined;
|
|
122
|
+
requestSignUp?: boolean | undefined;
|
|
123
|
+
loginHint?: string | undefined;
|
|
124
|
+
additionalData?: Record<string, any> | undefined;
|
|
125
|
+
} & {
|
|
126
|
+
fetchOptions?: FetchOptions | undefined;
|
|
127
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
|
|
128
|
+
redirect: boolean;
|
|
129
|
+
url: string;
|
|
130
|
+
} | (Omit<{
|
|
131
|
+
redirect: boolean;
|
|
132
|
+
token: string;
|
|
133
|
+
url: undefined;
|
|
134
|
+
user: {
|
|
135
|
+
id: string;
|
|
136
|
+
createdAt: Date;
|
|
137
|
+
updatedAt: Date;
|
|
138
|
+
email: string;
|
|
139
|
+
emailVerified: boolean;
|
|
140
|
+
name: string;
|
|
141
|
+
image?: string | null | undefined | undefined;
|
|
142
|
+
};
|
|
143
|
+
}, "user"> & {
|
|
144
|
+
user: import("better-auth/react").StripEmptyObjects<{
|
|
145
|
+
id: string;
|
|
146
|
+
createdAt: Date;
|
|
147
|
+
updatedAt: Date;
|
|
148
|
+
email: string;
|
|
149
|
+
emailVerified: boolean;
|
|
150
|
+
name: string;
|
|
151
|
+
image?: string | null | undefined;
|
|
152
|
+
}>;
|
|
153
|
+
}), {
|
|
154
|
+
code?: string | undefined;
|
|
155
|
+
message?: string | undefined;
|
|
156
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
157
|
+
};
|
|
158
|
+
} & {
|
|
10
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<{
|
|
11
160
|
query?: Record<string, any> | undefined;
|
|
12
161
|
fetchOptions?: FetchOptions | undefined;
|
|
@@ -16,6 +165,111 @@ export declare const authClient: {
|
|
|
16
165
|
code?: string | undefined;
|
|
17
166
|
message?: string | undefined;
|
|
18
167
|
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
168
|
+
} & {
|
|
169
|
+
signUp: {
|
|
170
|
+
email: <FetchOptions extends import("@better-auth/core").ClientFetchOption<Partial<{
|
|
171
|
+
name: string;
|
|
172
|
+
email: string;
|
|
173
|
+
password: string;
|
|
174
|
+
image?: string | undefined;
|
|
175
|
+
callbackURL?: string | undefined;
|
|
176
|
+
rememberMe?: boolean | undefined;
|
|
177
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/react").Prettify<{
|
|
178
|
+
email: string;
|
|
179
|
+
name: string;
|
|
180
|
+
password: string;
|
|
181
|
+
image?: string | undefined;
|
|
182
|
+
callbackURL?: string | undefined;
|
|
183
|
+
fetchOptions?: FetchOptions | undefined;
|
|
184
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<(Omit<{
|
|
185
|
+
token: null;
|
|
186
|
+
user: {
|
|
187
|
+
id: string;
|
|
188
|
+
createdAt: Date;
|
|
189
|
+
updatedAt: Date;
|
|
190
|
+
email: string;
|
|
191
|
+
emailVerified: boolean;
|
|
192
|
+
name: string;
|
|
193
|
+
image?: string | null | undefined | undefined;
|
|
194
|
+
};
|
|
195
|
+
}, "user"> & {
|
|
196
|
+
user: import("better-auth/react").StripEmptyObjects<{
|
|
197
|
+
id: string;
|
|
198
|
+
createdAt: Date;
|
|
199
|
+
updatedAt: Date;
|
|
200
|
+
email: string;
|
|
201
|
+
emailVerified: boolean;
|
|
202
|
+
name: string;
|
|
203
|
+
image?: string | null | undefined;
|
|
204
|
+
}>;
|
|
205
|
+
}) | (Omit<{
|
|
206
|
+
token: string;
|
|
207
|
+
user: {
|
|
208
|
+
id: string;
|
|
209
|
+
createdAt: Date;
|
|
210
|
+
updatedAt: Date;
|
|
211
|
+
email: string;
|
|
212
|
+
emailVerified: boolean;
|
|
213
|
+
name: string;
|
|
214
|
+
image?: string | null | undefined | undefined;
|
|
215
|
+
};
|
|
216
|
+
}, "user"> & {
|
|
217
|
+
user: import("better-auth/react").StripEmptyObjects<{
|
|
218
|
+
id: string;
|
|
219
|
+
createdAt: Date;
|
|
220
|
+
updatedAt: Date;
|
|
221
|
+
email: string;
|
|
222
|
+
emailVerified: boolean;
|
|
223
|
+
name: string;
|
|
224
|
+
image?: string | null | undefined;
|
|
225
|
+
}>;
|
|
226
|
+
}), {
|
|
227
|
+
code?: string | undefined;
|
|
228
|
+
message?: string | undefined;
|
|
229
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
230
|
+
};
|
|
231
|
+
} & {
|
|
232
|
+
signIn: {
|
|
233
|
+
email: <FetchOptions extends import("@better-auth/core").ClientFetchOption<Partial<{
|
|
234
|
+
email: string;
|
|
235
|
+
password: string;
|
|
236
|
+
callbackURL?: string | undefined;
|
|
237
|
+
rememberMe?: boolean | undefined;
|
|
238
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/react").Prettify<{
|
|
239
|
+
email: string;
|
|
240
|
+
password: string;
|
|
241
|
+
callbackURL?: string | undefined;
|
|
242
|
+
rememberMe?: boolean | undefined;
|
|
243
|
+
} & {
|
|
244
|
+
fetchOptions?: FetchOptions | undefined;
|
|
245
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<Omit<{
|
|
246
|
+
redirect: boolean;
|
|
247
|
+
token: string;
|
|
248
|
+
url?: string | undefined;
|
|
249
|
+
user: {
|
|
250
|
+
id: string;
|
|
251
|
+
createdAt: Date;
|
|
252
|
+
updatedAt: Date;
|
|
253
|
+
email: string;
|
|
254
|
+
emailVerified: boolean;
|
|
255
|
+
name: string;
|
|
256
|
+
image?: string | null | undefined | undefined;
|
|
257
|
+
};
|
|
258
|
+
}, "user"> & {
|
|
259
|
+
user: import("better-auth/react").StripEmptyObjects<{
|
|
260
|
+
id: string;
|
|
261
|
+
createdAt: Date;
|
|
262
|
+
updatedAt: Date;
|
|
263
|
+
email: string;
|
|
264
|
+
emailVerified: boolean;
|
|
265
|
+
name: string;
|
|
266
|
+
image?: string | null | undefined;
|
|
267
|
+
}>;
|
|
268
|
+
}, {
|
|
269
|
+
code?: string | undefined;
|
|
270
|
+
message?: string | undefined;
|
|
271
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
272
|
+
};
|
|
19
273
|
} & {
|
|
20
274
|
resetPassword: <FetchOptions extends import("@better-auth/core").ClientFetchOption<Partial<{
|
|
21
275
|
newPassword: string;
|
|
@@ -123,6 +377,134 @@ export declare const authClient: {
|
|
|
123
377
|
code?: string | undefined;
|
|
124
378
|
message?: string | undefined;
|
|
125
379
|
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
380
|
+
} & {
|
|
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
|
+
fetchOptions?: FetchOptions | undefined;
|
|
383
|
+
}> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
|
|
384
|
+
session: {
|
|
385
|
+
id: string;
|
|
386
|
+
createdAt: Date;
|
|
387
|
+
updatedAt: Date;
|
|
388
|
+
userId: string;
|
|
389
|
+
expiresAt: Date;
|
|
390
|
+
token: string;
|
|
391
|
+
ipAddress?: string | null | undefined;
|
|
392
|
+
userAgent?: string | null | undefined;
|
|
393
|
+
};
|
|
394
|
+
}, {
|
|
395
|
+
code?: string | undefined;
|
|
396
|
+
message?: string | undefined;
|
|
397
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
398
|
+
} & {
|
|
399
|
+
updateUser: <FetchOptions extends import("@better-auth/core").ClientFetchOption<Partial<Partial<{}> & {
|
|
400
|
+
name?: string | undefined;
|
|
401
|
+
image?: string | undefined | null;
|
|
402
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth/react").Prettify<import("better-auth/dist/client/path-to-object.mjs").InferUserUpdateCtx<{
|
|
403
|
+
plugins: {
|
|
404
|
+
id: "magic-link";
|
|
405
|
+
$InferServerPlugin: ReturnType<(options: import("better-auth/plugins/magic-link").MagicLinkOptions) => {
|
|
406
|
+
id: "magic-link";
|
|
407
|
+
endpoints: {
|
|
408
|
+
signInMagicLink: import("better-call").StrictEndpoint<"/sign-in/magic-link", {
|
|
409
|
+
method: "POST";
|
|
410
|
+
requireHeaders: true;
|
|
411
|
+
body: import("zod").ZodObject<{
|
|
412
|
+
email: import("zod").ZodEmail;
|
|
413
|
+
name: import("zod").ZodOptional<import("zod").ZodString>;
|
|
414
|
+
callbackURL: import("zod").ZodOptional<import("zod").ZodString>;
|
|
415
|
+
newUserCallbackURL: import("zod").ZodOptional<import("zod").ZodString>;
|
|
416
|
+
errorCallbackURL: import("zod").ZodOptional<import("zod").ZodString>;
|
|
417
|
+
metadata: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>>;
|
|
418
|
+
}, import("better-auth/*").$strip>;
|
|
419
|
+
metadata: {
|
|
420
|
+
openapi: {
|
|
421
|
+
operationId: string;
|
|
422
|
+
description: string;
|
|
423
|
+
responses: {
|
|
424
|
+
200: {
|
|
425
|
+
description: string;
|
|
426
|
+
content: {
|
|
427
|
+
"application/json": {
|
|
428
|
+
schema: {
|
|
429
|
+
type: "object";
|
|
430
|
+
properties: {
|
|
431
|
+
status: {
|
|
432
|
+
type: string;
|
|
433
|
+
};
|
|
434
|
+
};
|
|
435
|
+
};
|
|
436
|
+
};
|
|
437
|
+
};
|
|
438
|
+
};
|
|
439
|
+
};
|
|
440
|
+
};
|
|
441
|
+
};
|
|
442
|
+
}, {
|
|
443
|
+
status: boolean;
|
|
444
|
+
}>;
|
|
445
|
+
magicLinkVerify: import("better-call").StrictEndpoint<"/magic-link/verify", {
|
|
446
|
+
method: "GET";
|
|
447
|
+
query: import("zod").ZodObject<{
|
|
448
|
+
token: import("zod").ZodString;
|
|
449
|
+
callbackURL: import("zod").ZodOptional<import("zod").ZodString>;
|
|
450
|
+
errorCallbackURL: import("zod").ZodOptional<import("zod").ZodString>;
|
|
451
|
+
newUserCallbackURL: import("zod").ZodOptional<import("zod").ZodString>;
|
|
452
|
+
}, import("better-auth/*").$strip>;
|
|
453
|
+
use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<void>)[];
|
|
454
|
+
requireHeaders: true;
|
|
455
|
+
metadata: {
|
|
456
|
+
openapi: {
|
|
457
|
+
operationId: string;
|
|
458
|
+
description: string;
|
|
459
|
+
responses: {
|
|
460
|
+
200: {
|
|
461
|
+
description: string;
|
|
462
|
+
content: {
|
|
463
|
+
"application/json": {
|
|
464
|
+
schema: {
|
|
465
|
+
type: "object";
|
|
466
|
+
properties: {
|
|
467
|
+
session: {
|
|
468
|
+
$ref: string;
|
|
469
|
+
};
|
|
470
|
+
user: {
|
|
471
|
+
$ref: string;
|
|
472
|
+
};
|
|
473
|
+
};
|
|
474
|
+
};
|
|
475
|
+
};
|
|
476
|
+
};
|
|
477
|
+
};
|
|
478
|
+
};
|
|
479
|
+
};
|
|
480
|
+
};
|
|
481
|
+
}, {
|
|
482
|
+
token: string;
|
|
483
|
+
user: {
|
|
484
|
+
id: string;
|
|
485
|
+
createdAt: Date;
|
|
486
|
+
updatedAt: Date;
|
|
487
|
+
email: string;
|
|
488
|
+
emailVerified: boolean;
|
|
489
|
+
name: string;
|
|
490
|
+
image?: string | null | undefined;
|
|
491
|
+
};
|
|
492
|
+
}>;
|
|
493
|
+
};
|
|
494
|
+
rateLimit: {
|
|
495
|
+
pathMatcher(path: string): boolean;
|
|
496
|
+
window: number;
|
|
497
|
+
max: number;
|
|
498
|
+
}[];
|
|
499
|
+
options: import("better-auth/plugins/magic-link").MagicLinkOptions;
|
|
500
|
+
}>;
|
|
501
|
+
}[];
|
|
502
|
+
}, FetchOptions>> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
|
|
503
|
+
status: boolean;
|
|
504
|
+
}, {
|
|
505
|
+
code?: string | undefined;
|
|
506
|
+
message?: string | undefined;
|
|
507
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
126
508
|
} & {
|
|
127
509
|
deleteUser: <FetchOptions extends import("@better-auth/core").ClientFetchOption<Partial<{
|
|
128
510
|
callbackURL?: string | undefined;
|
|
@@ -372,222 +754,6 @@ export declare const authClient: {
|
|
|
372
754
|
code?: string | undefined;
|
|
373
755
|
message?: string | undefined;
|
|
374
756
|
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
375
|
-
} & {
|
|
376
|
-
signIn: {
|
|
377
|
-
social: <FetchOptions extends import("@better-auth/core").ClientFetchOption<Partial<{
|
|
378
|
-
provider: "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" | "railway" | "vercel" | "wechat" | (string & {});
|
|
379
|
-
callbackURL?: string | undefined;
|
|
380
|
-
newUserCallbackURL?: string | undefined;
|
|
381
|
-
errorCallbackURL?: string | undefined;
|
|
382
|
-
disableRedirect?: boolean | undefined;
|
|
383
|
-
idToken?: {
|
|
384
|
-
token: string;
|
|
385
|
-
nonce?: string | undefined;
|
|
386
|
-
accessToken?: string | undefined;
|
|
387
|
-
refreshToken?: string | undefined;
|
|
388
|
-
expiresAt?: number | undefined;
|
|
389
|
-
user?: {
|
|
390
|
-
name?: {
|
|
391
|
-
firstName?: string | undefined;
|
|
392
|
-
lastName?: string | undefined;
|
|
393
|
-
} | undefined;
|
|
394
|
-
email?: string | undefined;
|
|
395
|
-
} | undefined;
|
|
396
|
-
} | undefined;
|
|
397
|
-
scopes?: string[] | undefined;
|
|
398
|
-
requestSignUp?: boolean | undefined;
|
|
399
|
-
loginHint?: string | undefined;
|
|
400
|
-
additionalData?: Record<string, any> | undefined;
|
|
401
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/react").Prettify<{
|
|
402
|
-
provider: "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" | "railway" | "vercel" | "wechat" | (string & {});
|
|
403
|
-
callbackURL?: string | undefined;
|
|
404
|
-
newUserCallbackURL?: string | undefined;
|
|
405
|
-
errorCallbackURL?: string | undefined;
|
|
406
|
-
disableRedirect?: boolean | undefined;
|
|
407
|
-
idToken?: {
|
|
408
|
-
token: string;
|
|
409
|
-
nonce?: string | undefined;
|
|
410
|
-
accessToken?: string | undefined;
|
|
411
|
-
refreshToken?: string | undefined;
|
|
412
|
-
expiresAt?: number | undefined;
|
|
413
|
-
user?: {
|
|
414
|
-
name?: {
|
|
415
|
-
firstName?: string | undefined;
|
|
416
|
-
lastName?: string | undefined;
|
|
417
|
-
} | undefined;
|
|
418
|
-
email?: string | undefined;
|
|
419
|
-
} | undefined;
|
|
420
|
-
} | undefined;
|
|
421
|
-
scopes?: string[] | undefined;
|
|
422
|
-
requestSignUp?: boolean | undefined;
|
|
423
|
-
loginHint?: string | undefined;
|
|
424
|
-
additionalData?: Record<string, any> | undefined;
|
|
425
|
-
} & {
|
|
426
|
-
fetchOptions?: FetchOptions | undefined;
|
|
427
|
-
}>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
|
|
428
|
-
redirect: boolean;
|
|
429
|
-
url: string;
|
|
430
|
-
} | (Omit<{
|
|
431
|
-
redirect: boolean;
|
|
432
|
-
token: string;
|
|
433
|
-
url: undefined;
|
|
434
|
-
user: {
|
|
435
|
-
id: string;
|
|
436
|
-
createdAt: Date;
|
|
437
|
-
updatedAt: Date;
|
|
438
|
-
email: string;
|
|
439
|
-
emailVerified: boolean;
|
|
440
|
-
name: string;
|
|
441
|
-
image?: string | null | undefined | undefined;
|
|
442
|
-
};
|
|
443
|
-
}, "user"> & {
|
|
444
|
-
user: import("better-auth/react").StripEmptyObjects<{
|
|
445
|
-
id: string;
|
|
446
|
-
createdAt: Date;
|
|
447
|
-
updatedAt: Date;
|
|
448
|
-
email: string;
|
|
449
|
-
emailVerified: boolean;
|
|
450
|
-
name: string;
|
|
451
|
-
image?: string | null | undefined;
|
|
452
|
-
}>;
|
|
453
|
-
}), {
|
|
454
|
-
code?: string | undefined;
|
|
455
|
-
message?: string | undefined;
|
|
456
|
-
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
457
|
-
};
|
|
458
|
-
} & {
|
|
459
|
-
signUp: {
|
|
460
|
-
email: <FetchOptions extends import("@better-auth/core").ClientFetchOption<Partial<{
|
|
461
|
-
name: string;
|
|
462
|
-
email: string;
|
|
463
|
-
password: string;
|
|
464
|
-
image?: string | undefined;
|
|
465
|
-
callbackURL?: string | undefined;
|
|
466
|
-
rememberMe?: boolean | undefined;
|
|
467
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/react").Prettify<{
|
|
468
|
-
email: string;
|
|
469
|
-
name: string;
|
|
470
|
-
password: string;
|
|
471
|
-
image?: string | undefined;
|
|
472
|
-
callbackURL?: string | undefined;
|
|
473
|
-
fetchOptions?: FetchOptions | undefined;
|
|
474
|
-
}>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<(Omit<{
|
|
475
|
-
token: null;
|
|
476
|
-
user: {
|
|
477
|
-
id: string;
|
|
478
|
-
createdAt: Date;
|
|
479
|
-
updatedAt: Date;
|
|
480
|
-
email: string;
|
|
481
|
-
emailVerified: boolean;
|
|
482
|
-
name: string;
|
|
483
|
-
image?: string | null | undefined | undefined;
|
|
484
|
-
};
|
|
485
|
-
}, "user"> & {
|
|
486
|
-
user: import("better-auth/react").StripEmptyObjects<{
|
|
487
|
-
id: string;
|
|
488
|
-
createdAt: Date;
|
|
489
|
-
updatedAt: Date;
|
|
490
|
-
email: string;
|
|
491
|
-
emailVerified: boolean;
|
|
492
|
-
name: string;
|
|
493
|
-
image?: string | null | undefined;
|
|
494
|
-
}>;
|
|
495
|
-
}) | (Omit<{
|
|
496
|
-
token: string;
|
|
497
|
-
user: {
|
|
498
|
-
id: string;
|
|
499
|
-
createdAt: Date;
|
|
500
|
-
updatedAt: Date;
|
|
501
|
-
email: string;
|
|
502
|
-
emailVerified: boolean;
|
|
503
|
-
name: string;
|
|
504
|
-
image?: string | null | undefined | undefined;
|
|
505
|
-
};
|
|
506
|
-
}, "user"> & {
|
|
507
|
-
user: import("better-auth/react").StripEmptyObjects<{
|
|
508
|
-
id: string;
|
|
509
|
-
createdAt: Date;
|
|
510
|
-
updatedAt: Date;
|
|
511
|
-
email: string;
|
|
512
|
-
emailVerified: boolean;
|
|
513
|
-
name: string;
|
|
514
|
-
image?: string | null | undefined;
|
|
515
|
-
}>;
|
|
516
|
-
}), {
|
|
517
|
-
code?: string | undefined;
|
|
518
|
-
message?: string | undefined;
|
|
519
|
-
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
520
|
-
};
|
|
521
|
-
} & {
|
|
522
|
-
signIn: {
|
|
523
|
-
email: <FetchOptions extends import("@better-auth/core").ClientFetchOption<Partial<{
|
|
524
|
-
email: string;
|
|
525
|
-
password: string;
|
|
526
|
-
callbackURL?: string | undefined;
|
|
527
|
-
rememberMe?: boolean | undefined;
|
|
528
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/react").Prettify<{
|
|
529
|
-
email: string;
|
|
530
|
-
password: string;
|
|
531
|
-
callbackURL?: string | undefined;
|
|
532
|
-
rememberMe?: boolean | undefined;
|
|
533
|
-
} & {
|
|
534
|
-
fetchOptions?: FetchOptions | undefined;
|
|
535
|
-
}>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<Omit<{
|
|
536
|
-
redirect: boolean;
|
|
537
|
-
token: string;
|
|
538
|
-
url?: string | undefined;
|
|
539
|
-
user: {
|
|
540
|
-
id: string;
|
|
541
|
-
createdAt: Date;
|
|
542
|
-
updatedAt: Date;
|
|
543
|
-
email: string;
|
|
544
|
-
emailVerified: boolean;
|
|
545
|
-
name: string;
|
|
546
|
-
image?: string | null | undefined | undefined;
|
|
547
|
-
};
|
|
548
|
-
}, "user"> & {
|
|
549
|
-
user: import("better-auth/react").StripEmptyObjects<{
|
|
550
|
-
id: string;
|
|
551
|
-
createdAt: Date;
|
|
552
|
-
updatedAt: Date;
|
|
553
|
-
email: string;
|
|
554
|
-
emailVerified: boolean;
|
|
555
|
-
name: string;
|
|
556
|
-
image?: string | null | undefined;
|
|
557
|
-
}>;
|
|
558
|
-
}, {
|
|
559
|
-
code?: string | undefined;
|
|
560
|
-
message?: string | undefined;
|
|
561
|
-
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
562
|
-
};
|
|
563
|
-
} & {
|
|
564
|
-
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<{}> & {
|
|
565
|
-
fetchOptions?: FetchOptions | undefined;
|
|
566
|
-
}> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
|
|
567
|
-
session: {
|
|
568
|
-
id: string;
|
|
569
|
-
createdAt: Date;
|
|
570
|
-
updatedAt: Date;
|
|
571
|
-
userId: string;
|
|
572
|
-
expiresAt: Date;
|
|
573
|
-
token: string;
|
|
574
|
-
ipAddress?: string | null | undefined;
|
|
575
|
-
userAgent?: string | null | undefined;
|
|
576
|
-
};
|
|
577
|
-
}, {
|
|
578
|
-
code?: string | undefined;
|
|
579
|
-
message?: string | undefined;
|
|
580
|
-
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
581
|
-
} & {
|
|
582
|
-
updateUser: <FetchOptions extends import("@better-auth/core").ClientFetchOption<Partial<Partial<{}> & {
|
|
583
|
-
name?: string | undefined;
|
|
584
|
-
image?: string | undefined | null;
|
|
585
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth/react").Prettify<import("better-auth/dist/client/path-to-object.mjs").InferUserUpdateCtx<{}, FetchOptions>> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
|
|
586
|
-
status: boolean;
|
|
587
|
-
}, {
|
|
588
|
-
code?: string | undefined;
|
|
589
|
-
message?: string | undefined;
|
|
590
|
-
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
591
757
|
} & {
|
|
592
758
|
getSession: <FetchOptions extends import("@better-auth/core").ClientFetchOption<never, Partial<{
|
|
593
759
|
disableCookieCache?: unknown;
|
|
@@ -826,8 +992,31 @@ export declare const useSession: () => {
|
|
|
826
992
|
query?: import("better-auth/types").SessionQueryParams;
|
|
827
993
|
} | undefined) => Promise<void>;
|
|
828
994
|
}, signIn: {
|
|
995
|
+
magicLink: <FetchOptions extends import("@better-auth/core").ClientFetchOption<Partial<{
|
|
996
|
+
email: string;
|
|
997
|
+
name?: string | undefined;
|
|
998
|
+
callbackURL?: string | undefined;
|
|
999
|
+
newUserCallbackURL?: string | undefined;
|
|
1000
|
+
errorCallbackURL?: string | undefined;
|
|
1001
|
+
metadata?: Record<string, any> | undefined;
|
|
1002
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/react").Prettify<{
|
|
1003
|
+
email: string;
|
|
1004
|
+
name?: string | undefined;
|
|
1005
|
+
callbackURL?: string | undefined;
|
|
1006
|
+
newUserCallbackURL?: string | undefined;
|
|
1007
|
+
errorCallbackURL?: string | undefined;
|
|
1008
|
+
metadata?: Record<string, any> | undefined;
|
|
1009
|
+
} & {
|
|
1010
|
+
fetchOptions?: FetchOptions | undefined;
|
|
1011
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
|
|
1012
|
+
status: boolean;
|
|
1013
|
+
}, {
|
|
1014
|
+
code?: string | undefined;
|
|
1015
|
+
message?: string | undefined;
|
|
1016
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
1017
|
+
} & {
|
|
829
1018
|
social: <FetchOptions extends import("@better-auth/core").ClientFetchOption<Partial<{
|
|
830
|
-
provider: "github" | "apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "
|
|
1019
|
+
provider: (string & {}) | "linear" | "huggingface" | "github" | "apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "railway" | "vercel" | "wechat";
|
|
831
1020
|
callbackURL?: string | undefined;
|
|
832
1021
|
newUserCallbackURL?: string | undefined;
|
|
833
1022
|
errorCallbackURL?: string | undefined;
|
|
@@ -851,7 +1040,7 @@ export declare const useSession: () => {
|
|
|
851
1040
|
loginHint?: string | undefined;
|
|
852
1041
|
additionalData?: Record<string, any> | undefined;
|
|
853
1042
|
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/react").Prettify<{
|
|
854
|
-
provider: "github" | "apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "
|
|
1043
|
+
provider: (string & {}) | "linear" | "huggingface" | "github" | "apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "railway" | "vercel" | "wechat";
|
|
855
1044
|
callbackURL?: string | undefined;
|
|
856
1045
|
newUserCallbackURL?: string | undefined;
|
|
857
1046
|
errorCallbackURL?: string | undefined;
|