@payez/next-mvp 4.0.49 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth/better-auth.d.ts +122 -2
- package/dist/auth/better-auth.js +24 -2
- package/dist/client/better-auth-client.d.ts +216 -216
- package/dist/lib/session-store.js +21 -21
- package/dist/server/auth.d.ts +96 -25
- package/dist/server/auth.js +49 -103
- package/dist/vibe/hooks/index.d.ts +1 -1
- package/package.json +1 -1
- package/src/auth/better-auth.ts +408 -368
- package/src/lib/session-store.ts +689 -689
- package/src/server/auth.ts +78 -188
- package/src/server/decode-session.ts +200 -200
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
* @see BETTER-AUTH-MIGRATION-SPEC.md
|
|
10
10
|
*/
|
|
11
11
|
import 'server-only';
|
|
12
|
+
import { type MagicLinkOptions } from 'better-auth/plugins/magic-link';
|
|
12
13
|
import type { IDPClientConfig } from '../lib/idp-client-config';
|
|
13
14
|
/**
|
|
14
15
|
* Better Auth social provider config shape.
|
|
@@ -22,13 +23,25 @@ export interface BetterAuthSocialProvider {
|
|
|
22
23
|
* Build Better Auth social providers from IDP config.
|
|
23
24
|
*/
|
|
24
25
|
export declare function buildBetterAuthProviders(config: IDPClientConfig): Record<string, BetterAuthSocialProvider>;
|
|
26
|
+
/**
|
|
27
|
+
* Optional configuration for `createBetterAuthInstance`.
|
|
28
|
+
*
|
|
29
|
+
* - `magicLink`: if provided, registers Better Auth's magic-link plugin.
|
|
30
|
+
* The host app supplies its own `sendMagicLink` callback — typically a
|
|
31
|
+
* fetch to its email service (e.g. ACP's `/v1/auth/magic-link/email`).
|
|
32
|
+
* Omit the `magicLink` key entirely to skip the plugin; the consuming
|
|
33
|
+
* app will not have a magic-link flow.
|
|
34
|
+
*/
|
|
35
|
+
export interface CreateBetterAuthInstanceOptions {
|
|
36
|
+
magicLink?: MagicLinkOptions;
|
|
37
|
+
}
|
|
25
38
|
/**
|
|
26
39
|
* Create Better Auth instance from IDP config.
|
|
27
40
|
*
|
|
28
41
|
* No database — runs in stateless mode with JWE cookie cache.
|
|
29
42
|
* Call after getIDPClientConfig() resolves.
|
|
30
43
|
*/
|
|
31
|
-
export declare function createBetterAuthInstance(idpConfig: IDPClientConfig): import("better-auth").Auth<{
|
|
44
|
+
export declare function createBetterAuthInstance(idpConfig: IDPClientConfig, opts?: CreateBetterAuthInstanceOptions): import("better-auth").Auth<{
|
|
32
45
|
baseURL: string;
|
|
33
46
|
secret: string;
|
|
34
47
|
socialProviders: Record<string, BetterAuthSocialProvider>;
|
|
@@ -65,7 +78,102 @@ export declare function createBetterAuthInstance(idpConfig: IDPClientConfig): im
|
|
|
65
78
|
handler: (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<void>;
|
|
66
79
|
}[];
|
|
67
80
|
};
|
|
68
|
-
}
|
|
81
|
+
}, ...{
|
|
82
|
+
id: "magic-link";
|
|
83
|
+
endpoints: {
|
|
84
|
+
signInMagicLink: import("better-auth").StrictEndpoint<"/sign-in/magic-link", {
|
|
85
|
+
method: "POST";
|
|
86
|
+
requireHeaders: true;
|
|
87
|
+
body: import("better-auth").ZodObject<{
|
|
88
|
+
email: import("better-auth").ZodEmail;
|
|
89
|
+
name: import("better-auth").ZodOptional<import("better-auth").ZodString>;
|
|
90
|
+
callbackURL: import("better-auth").ZodOptional<import("better-auth").ZodString>;
|
|
91
|
+
newUserCallbackURL: import("better-auth").ZodOptional<import("better-auth").ZodString>;
|
|
92
|
+
errorCallbackURL: import("better-auth").ZodOptional<import("better-auth").ZodString>;
|
|
93
|
+
metadata: import("better-auth").ZodOptional<import("better-auth").ZodRecord<import("better-auth").ZodString, import("better-auth").ZodAny>>;
|
|
94
|
+
}, import("better-auth").$strip>;
|
|
95
|
+
metadata: {
|
|
96
|
+
openapi: {
|
|
97
|
+
operationId: string;
|
|
98
|
+
description: string;
|
|
99
|
+
responses: {
|
|
100
|
+
200: {
|
|
101
|
+
description: string;
|
|
102
|
+
content: {
|
|
103
|
+
"application/json": {
|
|
104
|
+
schema: {
|
|
105
|
+
type: "object";
|
|
106
|
+
properties: {
|
|
107
|
+
status: {
|
|
108
|
+
type: string;
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
}, {
|
|
119
|
+
status: boolean;
|
|
120
|
+
}>;
|
|
121
|
+
magicLinkVerify: import("better-auth").StrictEndpoint<"/magic-link/verify", {
|
|
122
|
+
method: "GET";
|
|
123
|
+
query: import("better-auth").ZodObject<{
|
|
124
|
+
token: import("better-auth").ZodString;
|
|
125
|
+
callbackURL: import("better-auth").ZodOptional<import("better-auth").ZodString>;
|
|
126
|
+
errorCallbackURL: import("better-auth").ZodOptional<import("better-auth").ZodString>;
|
|
127
|
+
newUserCallbackURL: import("better-auth").ZodOptional<import("better-auth").ZodString>;
|
|
128
|
+
}, import("better-auth").$strip>;
|
|
129
|
+
use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<void>)[];
|
|
130
|
+
requireHeaders: true;
|
|
131
|
+
metadata: {
|
|
132
|
+
openapi: {
|
|
133
|
+
operationId: string;
|
|
134
|
+
description: string;
|
|
135
|
+
responses: {
|
|
136
|
+
200: {
|
|
137
|
+
description: string;
|
|
138
|
+
content: {
|
|
139
|
+
"application/json": {
|
|
140
|
+
schema: {
|
|
141
|
+
type: "object";
|
|
142
|
+
properties: {
|
|
143
|
+
session: {
|
|
144
|
+
$ref: string;
|
|
145
|
+
};
|
|
146
|
+
user: {
|
|
147
|
+
$ref: string;
|
|
148
|
+
};
|
|
149
|
+
};
|
|
150
|
+
};
|
|
151
|
+
};
|
|
152
|
+
};
|
|
153
|
+
};
|
|
154
|
+
};
|
|
155
|
+
};
|
|
156
|
+
};
|
|
157
|
+
}, {
|
|
158
|
+
token: string;
|
|
159
|
+
user: {
|
|
160
|
+
id: string;
|
|
161
|
+
createdAt: Date;
|
|
162
|
+
updatedAt: Date;
|
|
163
|
+
email: string;
|
|
164
|
+
emailVerified: boolean;
|
|
165
|
+
name: string;
|
|
166
|
+
image?: string | null | undefined;
|
|
167
|
+
};
|
|
168
|
+
}>;
|
|
169
|
+
};
|
|
170
|
+
rateLimit: {
|
|
171
|
+
pathMatcher(path: string): boolean;
|
|
172
|
+
window: number;
|
|
173
|
+
max: number;
|
|
174
|
+
}[];
|
|
175
|
+
options: MagicLinkOptions;
|
|
176
|
+
}[]];
|
|
69
177
|
}>;
|
|
70
178
|
/**
|
|
71
179
|
* Better Auth is always enabled (NextAuth removed in 4.0).
|
|
@@ -77,6 +185,18 @@ export declare function isBetterAuthEnabled(): boolean;
|
|
|
77
185
|
*/
|
|
78
186
|
declare let cachedInstance: any;
|
|
79
187
|
export { cachedInstance as __betterAuthInstance };
|
|
188
|
+
/**
|
|
189
|
+
* Configure Better Auth instance options for this process.
|
|
190
|
+
*
|
|
191
|
+
* Must be called before the first auth request — before
|
|
192
|
+
* `getBetterAuthInstance()` caches an instance. Typically called once at
|
|
193
|
+
* app startup, e.g. from Next.js `instrumentation.ts` or an equivalent
|
|
194
|
+
* server bootstrap hook.
|
|
195
|
+
*
|
|
196
|
+
* Throws if called after the instance has already been resolved: options
|
|
197
|
+
* cannot be applied retroactively.
|
|
198
|
+
*/
|
|
199
|
+
export declare function configureBetterAuth(opts: CreateBetterAuthInstanceOptions): void;
|
|
80
200
|
export declare function getBetterAuthInstance(): Promise<any>;
|
|
81
201
|
/**
|
|
82
202
|
* Get flag-gated auth handler for Next.js route.
|
package/dist/auth/better-auth.js
CHANGED
|
@@ -47,6 +47,7 @@ exports.__betterAuthInstance = void 0;
|
|
|
47
47
|
exports.buildBetterAuthProviders = buildBetterAuthProviders;
|
|
48
48
|
exports.createBetterAuthInstance = createBetterAuthInstance;
|
|
49
49
|
exports.isBetterAuthEnabled = isBetterAuthEnabled;
|
|
50
|
+
exports.configureBetterAuth = configureBetterAuth;
|
|
50
51
|
exports.getBetterAuthInstance = getBetterAuthInstance;
|
|
51
52
|
exports.getBetterAuthHandler = getBetterAuthHandler;
|
|
52
53
|
exports.exchangeOAuthForIdpTokens = exchangeOAuthForIdpTokens;
|
|
@@ -55,6 +56,7 @@ require("server-only");
|
|
|
55
56
|
const better_auth_1 = require("better-auth");
|
|
56
57
|
const next_js_1 = require("better-auth/next-js");
|
|
57
58
|
const next_js_2 = require("better-auth/next-js");
|
|
59
|
+
const magic_link_1 = require("better-auth/plugins/magic-link");
|
|
58
60
|
const idp_client_config_1 = require("../lib/idp-client-config");
|
|
59
61
|
const app_slug_1 = require("../lib/app-slug");
|
|
60
62
|
const redis_1 = require("../lib/redis");
|
|
@@ -81,7 +83,7 @@ function buildBetterAuthProviders(config) {
|
|
|
81
83
|
* No database — runs in stateless mode with JWE cookie cache.
|
|
82
84
|
* Call after getIDPClientConfig() resolves.
|
|
83
85
|
*/
|
|
84
|
-
function createBetterAuthInstance(idpConfig) {
|
|
86
|
+
function createBetterAuthInstance(idpConfig, opts = {}) {
|
|
85
87
|
const appSlug = idpConfig.clientSlug || (0, app_slug_1.getAppSlug)();
|
|
86
88
|
// Resolve base URL: BETTER_AUTH_URL env > IDP config > localhost fallback
|
|
87
89
|
// Must include /api/auth since that's where the catch-all route is mounted
|
|
@@ -149,6 +151,7 @@ function createBetterAuthInstance(idpConfig) {
|
|
|
149
151
|
},
|
|
150
152
|
plugins: [
|
|
151
153
|
(0, next_js_1.nextCookies)(),
|
|
154
|
+
...(opts.magicLink ? [(0, magic_link_1.magicLink)(opts.magicLink)] : []),
|
|
152
155
|
],
|
|
153
156
|
});
|
|
154
157
|
}
|
|
@@ -167,12 +170,31 @@ let cachedInstance = null;
|
|
|
167
170
|
exports.__betterAuthInstance = cachedInstance;
|
|
168
171
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
169
172
|
let initPromise = null;
|
|
173
|
+
let configuredOpts = {};
|
|
174
|
+
/**
|
|
175
|
+
* Configure Better Auth instance options for this process.
|
|
176
|
+
*
|
|
177
|
+
* Must be called before the first auth request — before
|
|
178
|
+
* `getBetterAuthInstance()` caches an instance. Typically called once at
|
|
179
|
+
* app startup, e.g. from Next.js `instrumentation.ts` or an equivalent
|
|
180
|
+
* server bootstrap hook.
|
|
181
|
+
*
|
|
182
|
+
* Throws if called after the instance has already been resolved: options
|
|
183
|
+
* cannot be applied retroactively.
|
|
184
|
+
*/
|
|
185
|
+
function configureBetterAuth(opts) {
|
|
186
|
+
if (cachedInstance) {
|
|
187
|
+
throw new Error('[BETTER_AUTH] configureBetterAuth() must run before the instance is first resolved. ' +
|
|
188
|
+
'Call it in Next.js instrumentation.ts or an equivalent startup hook.');
|
|
189
|
+
}
|
|
190
|
+
configuredOpts = opts;
|
|
191
|
+
}
|
|
170
192
|
async function getBetterAuthInstance() {
|
|
171
193
|
if (cachedInstance)
|
|
172
194
|
return cachedInstance;
|
|
173
195
|
if (!initPromise) {
|
|
174
196
|
initPromise = (0, idp_client_config_1.getIDPClientConfig)(true).then(config => {
|
|
175
|
-
const instance = createBetterAuthInstance(config);
|
|
197
|
+
const instance = createBetterAuthInstance(config, configuredOpts);
|
|
176
198
|
exports.__betterAuthInstance = cachedInstance = instance;
|
|
177
199
|
console.log('[BETTER_AUTH] Instance created for', config.clientSlug || config.clientId);
|
|
178
200
|
return instance;
|
|
@@ -7,89 +7,6 @@
|
|
|
7
7
|
* components written against the legacy hook don't need destructure changes.
|
|
8
8
|
*/
|
|
9
9
|
export declare const authClient: {
|
|
10
|
-
signIn: {
|
|
11
|
-
social: <FetchOptions extends import("@better-auth/core").ClientFetchOption<Partial<{
|
|
12
|
-
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 & {});
|
|
13
|
-
callbackURL?: string | undefined;
|
|
14
|
-
newUserCallbackURL?: string | undefined;
|
|
15
|
-
errorCallbackURL?: string | undefined;
|
|
16
|
-
disableRedirect?: boolean | undefined;
|
|
17
|
-
idToken?: {
|
|
18
|
-
token: string;
|
|
19
|
-
nonce?: string | undefined;
|
|
20
|
-
accessToken?: string | undefined;
|
|
21
|
-
refreshToken?: string | undefined;
|
|
22
|
-
expiresAt?: number | undefined;
|
|
23
|
-
user?: {
|
|
24
|
-
name?: {
|
|
25
|
-
firstName?: string | undefined;
|
|
26
|
-
lastName?: string | undefined;
|
|
27
|
-
} | undefined;
|
|
28
|
-
email?: string | undefined;
|
|
29
|
-
} | undefined;
|
|
30
|
-
} | undefined;
|
|
31
|
-
scopes?: string[] | undefined;
|
|
32
|
-
requestSignUp?: boolean | undefined;
|
|
33
|
-
loginHint?: string | undefined;
|
|
34
|
-
additionalData?: Record<string, any> | undefined;
|
|
35
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/react").Prettify<{
|
|
36
|
-
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 & {});
|
|
37
|
-
callbackURL?: string | undefined;
|
|
38
|
-
newUserCallbackURL?: string | undefined;
|
|
39
|
-
errorCallbackURL?: string | undefined;
|
|
40
|
-
disableRedirect?: boolean | undefined;
|
|
41
|
-
idToken?: {
|
|
42
|
-
token: string;
|
|
43
|
-
nonce?: string | undefined;
|
|
44
|
-
accessToken?: string | undefined;
|
|
45
|
-
refreshToken?: string | undefined;
|
|
46
|
-
expiresAt?: number | undefined;
|
|
47
|
-
user?: {
|
|
48
|
-
name?: {
|
|
49
|
-
firstName?: string | undefined;
|
|
50
|
-
lastName?: string | undefined;
|
|
51
|
-
} | undefined;
|
|
52
|
-
email?: string | undefined;
|
|
53
|
-
} | undefined;
|
|
54
|
-
} | undefined;
|
|
55
|
-
scopes?: string[] | undefined;
|
|
56
|
-
requestSignUp?: boolean | undefined;
|
|
57
|
-
loginHint?: string | undefined;
|
|
58
|
-
additionalData?: Record<string, any> | undefined;
|
|
59
|
-
} & {
|
|
60
|
-
fetchOptions?: FetchOptions | undefined;
|
|
61
|
-
}>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
|
|
62
|
-
redirect: boolean;
|
|
63
|
-
url: string;
|
|
64
|
-
} | (Omit<{
|
|
65
|
-
redirect: boolean;
|
|
66
|
-
token: string;
|
|
67
|
-
url: undefined;
|
|
68
|
-
user: {
|
|
69
|
-
id: string;
|
|
70
|
-
createdAt: Date;
|
|
71
|
-
updatedAt: Date;
|
|
72
|
-
email: string;
|
|
73
|
-
emailVerified: boolean;
|
|
74
|
-
name: string;
|
|
75
|
-
image?: string | null | undefined | undefined;
|
|
76
|
-
};
|
|
77
|
-
}, "user"> & {
|
|
78
|
-
user: import("better-auth/react").StripEmptyObjects<{
|
|
79
|
-
id: string;
|
|
80
|
-
createdAt: Date;
|
|
81
|
-
updatedAt: Date;
|
|
82
|
-
email: string;
|
|
83
|
-
emailVerified: boolean;
|
|
84
|
-
name: string;
|
|
85
|
-
image?: string | null | undefined;
|
|
86
|
-
}>;
|
|
87
|
-
}), {
|
|
88
|
-
code?: string | undefined;
|
|
89
|
-
message?: string | undefined;
|
|
90
|
-
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
91
|
-
};
|
|
92
|
-
} & {
|
|
93
10
|
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<{
|
|
94
11
|
query?: Record<string, any> | undefined;
|
|
95
12
|
fetchOptions?: FetchOptions | undefined;
|
|
@@ -99,111 +16,6 @@ export declare const authClient: {
|
|
|
99
16
|
code?: string | undefined;
|
|
100
17
|
message?: string | undefined;
|
|
101
18
|
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
102
|
-
} & {
|
|
103
|
-
signUp: {
|
|
104
|
-
email: <FetchOptions extends import("@better-auth/core").ClientFetchOption<Partial<{
|
|
105
|
-
name: string;
|
|
106
|
-
email: string;
|
|
107
|
-
password: string;
|
|
108
|
-
image?: string | undefined;
|
|
109
|
-
callbackURL?: string | undefined;
|
|
110
|
-
rememberMe?: boolean | undefined;
|
|
111
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/react").Prettify<{
|
|
112
|
-
email: string;
|
|
113
|
-
name: string;
|
|
114
|
-
password: string;
|
|
115
|
-
image?: string | undefined;
|
|
116
|
-
callbackURL?: string | undefined;
|
|
117
|
-
fetchOptions?: FetchOptions | undefined;
|
|
118
|
-
}>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<(Omit<{
|
|
119
|
-
token: null;
|
|
120
|
-
user: {
|
|
121
|
-
id: string;
|
|
122
|
-
createdAt: Date;
|
|
123
|
-
updatedAt: Date;
|
|
124
|
-
email: string;
|
|
125
|
-
emailVerified: boolean;
|
|
126
|
-
name: string;
|
|
127
|
-
image?: string | null | undefined | undefined;
|
|
128
|
-
};
|
|
129
|
-
}, "user"> & {
|
|
130
|
-
user: import("better-auth/react").StripEmptyObjects<{
|
|
131
|
-
id: string;
|
|
132
|
-
createdAt: Date;
|
|
133
|
-
updatedAt: Date;
|
|
134
|
-
email: string;
|
|
135
|
-
emailVerified: boolean;
|
|
136
|
-
name: string;
|
|
137
|
-
image?: string | null | undefined;
|
|
138
|
-
}>;
|
|
139
|
-
}) | (Omit<{
|
|
140
|
-
token: string;
|
|
141
|
-
user: {
|
|
142
|
-
id: string;
|
|
143
|
-
createdAt: Date;
|
|
144
|
-
updatedAt: Date;
|
|
145
|
-
email: string;
|
|
146
|
-
emailVerified: boolean;
|
|
147
|
-
name: string;
|
|
148
|
-
image?: string | null | undefined | undefined;
|
|
149
|
-
};
|
|
150
|
-
}, "user"> & {
|
|
151
|
-
user: import("better-auth/react").StripEmptyObjects<{
|
|
152
|
-
id: string;
|
|
153
|
-
createdAt: Date;
|
|
154
|
-
updatedAt: Date;
|
|
155
|
-
email: string;
|
|
156
|
-
emailVerified: boolean;
|
|
157
|
-
name: string;
|
|
158
|
-
image?: string | null | undefined;
|
|
159
|
-
}>;
|
|
160
|
-
}), {
|
|
161
|
-
code?: string | undefined;
|
|
162
|
-
message?: string | undefined;
|
|
163
|
-
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
164
|
-
};
|
|
165
|
-
} & {
|
|
166
|
-
signIn: {
|
|
167
|
-
email: <FetchOptions extends import("@better-auth/core").ClientFetchOption<Partial<{
|
|
168
|
-
email: string;
|
|
169
|
-
password: string;
|
|
170
|
-
callbackURL?: string | undefined;
|
|
171
|
-
rememberMe?: boolean | undefined;
|
|
172
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/react").Prettify<{
|
|
173
|
-
email: string;
|
|
174
|
-
password: string;
|
|
175
|
-
callbackURL?: string | undefined;
|
|
176
|
-
rememberMe?: boolean | undefined;
|
|
177
|
-
} & {
|
|
178
|
-
fetchOptions?: FetchOptions | undefined;
|
|
179
|
-
}>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<Omit<{
|
|
180
|
-
redirect: boolean;
|
|
181
|
-
token: string;
|
|
182
|
-
url?: string | undefined;
|
|
183
|
-
user: {
|
|
184
|
-
id: string;
|
|
185
|
-
createdAt: Date;
|
|
186
|
-
updatedAt: Date;
|
|
187
|
-
email: string;
|
|
188
|
-
emailVerified: boolean;
|
|
189
|
-
name: string;
|
|
190
|
-
image?: string | null | undefined | undefined;
|
|
191
|
-
};
|
|
192
|
-
}, "user"> & {
|
|
193
|
-
user: import("better-auth/react").StripEmptyObjects<{
|
|
194
|
-
id: string;
|
|
195
|
-
createdAt: Date;
|
|
196
|
-
updatedAt: Date;
|
|
197
|
-
email: string;
|
|
198
|
-
emailVerified: boolean;
|
|
199
|
-
name: string;
|
|
200
|
-
image?: string | null | undefined;
|
|
201
|
-
}>;
|
|
202
|
-
}, {
|
|
203
|
-
code?: string | undefined;
|
|
204
|
-
message?: string | undefined;
|
|
205
|
-
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
206
|
-
};
|
|
207
19
|
} & {
|
|
208
20
|
resetPassword: <FetchOptions extends import("@better-auth/core").ClientFetchOption<Partial<{
|
|
209
21
|
newPassword: string;
|
|
@@ -311,34 +123,6 @@ export declare const authClient: {
|
|
|
311
123
|
code?: string | undefined;
|
|
312
124
|
message?: string | undefined;
|
|
313
125
|
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
314
|
-
} & {
|
|
315
|
-
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<{}> & {
|
|
316
|
-
fetchOptions?: FetchOptions | undefined;
|
|
317
|
-
}> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
|
|
318
|
-
session: {
|
|
319
|
-
id: string;
|
|
320
|
-
createdAt: Date;
|
|
321
|
-
updatedAt: Date;
|
|
322
|
-
userId: string;
|
|
323
|
-
expiresAt: Date;
|
|
324
|
-
token: string;
|
|
325
|
-
ipAddress?: string | null | undefined;
|
|
326
|
-
userAgent?: string | null | undefined;
|
|
327
|
-
};
|
|
328
|
-
}, {
|
|
329
|
-
code?: string | undefined;
|
|
330
|
-
message?: string | undefined;
|
|
331
|
-
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
332
|
-
} & {
|
|
333
|
-
updateUser: <FetchOptions extends import("@better-auth/core").ClientFetchOption<Partial<Partial<{}> & {
|
|
334
|
-
name?: string | undefined;
|
|
335
|
-
image?: string | undefined | null;
|
|
336
|
-
}> & 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<{
|
|
337
|
-
status: boolean;
|
|
338
|
-
}, {
|
|
339
|
-
code?: string | undefined;
|
|
340
|
-
message?: string | undefined;
|
|
341
|
-
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
342
126
|
} & {
|
|
343
127
|
deleteUser: <FetchOptions extends import("@better-auth/core").ClientFetchOption<Partial<{
|
|
344
128
|
callbackURL?: string | undefined;
|
|
@@ -588,6 +372,222 @@ export declare const authClient: {
|
|
|
588
372
|
code?: string | undefined;
|
|
589
373
|
message?: string | undefined;
|
|
590
374
|
}, 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
591
|
} & {
|
|
592
592
|
getSession: <FetchOptions extends import("@better-auth/core").ClientFetchOption<never, Partial<{
|
|
593
593
|
disableCookieCache?: unknown;
|