@atzentis/auth-expo 0.1.0 → 0.2.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/CHANGELOG.md +21 -0
- package/dist/index.d.ts +967 -122
- package/dist/index.js +356 -443
- package/dist/index.js.map +1 -1
- package/package.json +26 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,100 +1,100 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import
|
|
2
|
+
import * as react from 'react';
|
|
3
|
+
import react__default, { ReactNode } from 'react';
|
|
3
4
|
import { TextInputProps, TextInput } from 'react-native';
|
|
5
|
+
import * as better_auth_client from 'better-auth/client';
|
|
6
|
+
import * as better_auth from 'better-auth';
|
|
4
7
|
import * as _atzentis_auth_locales from '@atzentis/auth-locales';
|
|
5
8
|
import { AuthLocalization } from '@atzentis/auth-locales';
|
|
6
9
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
7
10
|
import { QueryClient } from '@tanstack/react-query';
|
|
8
11
|
|
|
9
|
-
|
|
12
|
+
type AuthContainerProps = {
|
|
10
13
|
children: ReactNode;
|
|
11
|
-
}
|
|
14
|
+
};
|
|
12
15
|
/**
|
|
13
16
|
* Root layout for auth screens. Handles keyboard avoidance, safe area insets,
|
|
14
17
|
* and centering content on tablets.
|
|
15
18
|
*/
|
|
16
19
|
declare function AuthContainer({ children }: AuthContainerProps): react_jsx_runtime.JSX.Element;
|
|
17
20
|
|
|
18
|
-
|
|
21
|
+
type AuthGateProps = {
|
|
19
22
|
children: ReactNode;
|
|
20
23
|
fallback?: ReactNode;
|
|
21
|
-
}
|
|
24
|
+
};
|
|
22
25
|
declare function AuthGate({ children, fallback }: AuthGateProps): react_jsx_runtime.JSX.Element;
|
|
23
26
|
|
|
24
|
-
|
|
27
|
+
type ErrorFeedbackProps = {
|
|
25
28
|
message: string;
|
|
26
|
-
}
|
|
29
|
+
};
|
|
27
30
|
/**
|
|
28
31
|
* Displays an error message with a red alert icon.
|
|
29
32
|
* Used in auth screens to show validation or API errors.
|
|
30
33
|
*/
|
|
31
34
|
declare function ErrorFeedback({ message }: ErrorFeedbackProps): react_jsx_runtime.JSX.Element;
|
|
32
35
|
|
|
33
|
-
interface FormInputProps extends Omit<TextInputProps, "onChangeText" | "value"> {
|
|
34
|
-
error?: string;
|
|
35
|
-
label?: string;
|
|
36
|
-
onChangeText?: (text: string) => void;
|
|
37
|
-
value?: string;
|
|
38
|
-
}
|
|
39
36
|
/**
|
|
40
37
|
* Form text input with optional label and error display.
|
|
41
38
|
* Designed for react-hook-form Controller render prop.
|
|
42
39
|
*/
|
|
43
|
-
declare const FormInput:
|
|
44
|
-
|
|
45
|
-
interface FormPasswordInputProps extends Omit<TextInputProps, "onChangeText" | "value"> {
|
|
40
|
+
declare const FormInput: react.ForwardRefExoticComponent<Omit<TextInputProps, "value" | "onChangeText"> & {
|
|
46
41
|
error?: string;
|
|
47
42
|
label?: string;
|
|
48
43
|
onChangeText?: (text: string) => void;
|
|
49
44
|
value?: string;
|
|
50
|
-
}
|
|
45
|
+
} & react.RefAttributes<TextInput>>;
|
|
46
|
+
|
|
51
47
|
/**
|
|
52
48
|
* Form password input with show/hide toggle, optional label and error display.
|
|
53
49
|
* Designed for react-hook-form Controller render prop.
|
|
54
50
|
*/
|
|
55
|
-
declare const FormPasswordInput:
|
|
51
|
+
declare const FormPasswordInput: react.ForwardRefExoticComponent<Omit<TextInputProps, "value" | "onChangeText"> & {
|
|
52
|
+
error?: string;
|
|
53
|
+
label?: string;
|
|
54
|
+
onChangeText?: (text: string) => void;
|
|
55
|
+
value?: string;
|
|
56
|
+
} & react.RefAttributes<TextInput>>;
|
|
56
57
|
|
|
57
58
|
type OAuthProvider = "google" | "apple" | "github";
|
|
58
|
-
|
|
59
|
-
disabled?: boolean;
|
|
59
|
+
type OAuthButtonProps = {
|
|
60
60
|
onError?: (error: Error) => void;
|
|
61
61
|
onSuccess?: () => void;
|
|
62
62
|
provider: OAuthProvider;
|
|
63
|
-
}
|
|
64
|
-
declare function OAuthButton({
|
|
63
|
+
};
|
|
64
|
+
declare function OAuthButton({ onError, onSuccess, provider }: OAuthButtonProps): react_jsx_runtime.JSX.Element;
|
|
65
65
|
|
|
66
|
-
|
|
66
|
+
type ProtectedScreenProps = {
|
|
67
67
|
children: ReactNode;
|
|
68
68
|
fallback?: ReactNode;
|
|
69
|
-
}
|
|
69
|
+
};
|
|
70
70
|
declare function ProtectedScreen({ children, fallback }: ProtectedScreenProps): react_jsx_runtime.JSX.Element | null;
|
|
71
71
|
|
|
72
|
-
|
|
72
|
+
type SuccessFeedbackProps = {
|
|
73
73
|
message: string;
|
|
74
|
-
}
|
|
74
|
+
};
|
|
75
75
|
/**
|
|
76
76
|
* Displays a success message with a green checkmark icon.
|
|
77
77
|
*/
|
|
78
78
|
declare function SuccessFeedback({ message }: SuccessFeedbackProps): react_jsx_runtime.JSX.Element;
|
|
79
79
|
|
|
80
|
-
|
|
81
|
-
disabled?: boolean;
|
|
80
|
+
type SubmitButtonProps = {
|
|
82
81
|
label: string;
|
|
83
82
|
loading: boolean;
|
|
84
83
|
loadingLabel: string;
|
|
85
84
|
onPress: () => void;
|
|
86
|
-
|
|
85
|
+
disabled?: boolean;
|
|
86
|
+
};
|
|
87
87
|
/**
|
|
88
88
|
* Submit button with loading state and optional haptic feedback.
|
|
89
89
|
* Uses @expo/ui Button for native appearance inside Host wrapper.
|
|
90
90
|
*/
|
|
91
|
-
declare function SubmitButton({
|
|
91
|
+
declare function SubmitButton({ label, loading, loadingLabel, onPress, disabled, }: SubmitButtonProps): react_jsx_runtime.JSX.Element;
|
|
92
92
|
|
|
93
93
|
/**
|
|
94
94
|
* Available auth screen routes.
|
|
95
95
|
*/
|
|
96
96
|
type AuthRoute = "login" | "signup" | "phone-login" | "magic-link" | "forgot-password" | "reset-password" | "verify-email" | "two-factor";
|
|
97
|
-
|
|
97
|
+
type AuthViewProps = {
|
|
98
98
|
/** Which auth screen to render. Defaults to "login". */
|
|
99
99
|
route?: AuthRoute;
|
|
100
100
|
/** Called on successful authentication. */
|
|
@@ -107,7 +107,7 @@ interface AuthViewProps {
|
|
|
107
107
|
onBiometricPress?: () => void;
|
|
108
108
|
/** Fallback content when route doesn't match. */
|
|
109
109
|
fallback?: ReactNode;
|
|
110
|
-
}
|
|
110
|
+
};
|
|
111
111
|
/**
|
|
112
112
|
* AuthView — Route-based renderer for auth screens.
|
|
113
113
|
*
|
|
@@ -133,131 +133,921 @@ interface AuthViewProps {
|
|
|
133
133
|
*/
|
|
134
134
|
declare function AuthView({ route, onSuccess, token, biometricAvailable, onBiometricPress, fallback, }: AuthViewProps): react_jsx_runtime.JSX.Element;
|
|
135
135
|
|
|
136
|
-
|
|
136
|
+
type EmailVerificationScreenProps = {
|
|
137
137
|
onSuccess?: () => void;
|
|
138
138
|
token?: string;
|
|
139
|
-
}
|
|
139
|
+
};
|
|
140
140
|
/** Auto-verifies an email address using the `token` prop from a deep-link URL. */
|
|
141
141
|
declare function EmailVerificationScreen({ onSuccess, token }: EmailVerificationScreenProps): react_jsx_runtime.JSX.Element;
|
|
142
142
|
|
|
143
|
-
|
|
143
|
+
type ForgotPasswordScreenProps = {
|
|
144
144
|
onSuccess?: () => void;
|
|
145
|
-
}
|
|
145
|
+
};
|
|
146
146
|
/** Screen for requesting a password-reset email with a 60-second resend cooldown. */
|
|
147
147
|
declare function ForgotPasswordScreen({ onSuccess }: ForgotPasswordScreenProps): react_jsx_runtime.JSX.Element;
|
|
148
148
|
|
|
149
|
-
|
|
149
|
+
type LoginScreenProps = {
|
|
150
150
|
biometricAvailable?: boolean;
|
|
151
151
|
onBiometricPress?: () => void;
|
|
152
152
|
onSuccess?: () => void;
|
|
153
|
-
}
|
|
153
|
+
};
|
|
154
154
|
/** Email/password login screen with optional biometric button (iOS only). */
|
|
155
155
|
declare function LoginScreen({ biometricAvailable, onBiometricPress, onSuccess, }: LoginScreenProps): react_jsx_runtime.JSX.Element;
|
|
156
156
|
|
|
157
|
-
|
|
157
|
+
type MagicLinkScreenProps = {
|
|
158
158
|
onSuccess?: () => void;
|
|
159
159
|
token?: string;
|
|
160
|
-
}
|
|
160
|
+
};
|
|
161
161
|
/** Magic-link login screen: sends link via email, then auto-verifies when a `token` prop is provided. */
|
|
162
162
|
declare function MagicLinkScreen({ onSuccess, token }: MagicLinkScreenProps): react_jsx_runtime.JSX.Element;
|
|
163
163
|
|
|
164
|
-
|
|
164
|
+
type PhoneLoginScreenProps = {
|
|
165
165
|
onSuccess?: () => void;
|
|
166
|
-
}
|
|
166
|
+
};
|
|
167
167
|
/** Two-step phone login screen: collect phone number, then verify the OTP code sent via SMS. */
|
|
168
168
|
declare function PhoneLoginScreen({ onSuccess }: PhoneLoginScreenProps): react_jsx_runtime.JSX.Element;
|
|
169
169
|
|
|
170
|
-
|
|
170
|
+
type ResetPasswordScreenProps = {
|
|
171
171
|
onSuccess?: () => void;
|
|
172
172
|
token?: string;
|
|
173
|
-
}
|
|
173
|
+
};
|
|
174
174
|
/** Token-based password reset screen; shows an error state when no token is provided. */
|
|
175
175
|
declare function ResetPasswordScreen({ onSuccess, token }: ResetPasswordScreenProps): react_jsx_runtime.JSX.Element;
|
|
176
176
|
|
|
177
|
-
|
|
177
|
+
type SignupScreenProps = {
|
|
178
178
|
onSuccess?: () => void;
|
|
179
|
-
}
|
|
179
|
+
};
|
|
180
180
|
/** Email/password registration screen with name, email, and password fields. */
|
|
181
181
|
declare function SignupScreen({ onSuccess }: SignupScreenProps): react_jsx_runtime.JSX.Element;
|
|
182
182
|
|
|
183
|
-
|
|
183
|
+
type TwoFactorScreenProps = {
|
|
184
184
|
onSuccess?: () => void;
|
|
185
|
-
}
|
|
185
|
+
};
|
|
186
186
|
/** TOTP/backup-code verification screen shown after initial credentials are accepted. */
|
|
187
187
|
declare function TwoFactorScreen({ onSuccess }: TwoFactorScreenProps): react_jsx_runtime.JSX.Element;
|
|
188
188
|
|
|
189
|
-
|
|
189
|
+
type ChangeEmailScreenProps = {
|
|
190
190
|
onSuccess?: () => void;
|
|
191
191
|
redirectUrl?: string;
|
|
192
|
-
}
|
|
192
|
+
};
|
|
193
193
|
/** Settings screen for changing the account email address; sends a verification link with a resend cooldown. */
|
|
194
194
|
declare function ChangeEmailScreen({ onSuccess, redirectUrl }: ChangeEmailScreenProps): react_jsx_runtime.JSX.Element;
|
|
195
195
|
|
|
196
|
-
|
|
196
|
+
type ChangePasswordScreenProps = {
|
|
197
197
|
onSuccess?: () => void;
|
|
198
|
-
}
|
|
198
|
+
};
|
|
199
199
|
/** Settings screen for changing the current user's password (requires current password). */
|
|
200
200
|
declare function ChangePasswordScreen({ onSuccess }: ChangePasswordScreenProps): react_jsx_runtime.JSX.Element;
|
|
201
201
|
|
|
202
|
-
|
|
202
|
+
type DeleteAccountScreenProps = {
|
|
203
203
|
confirmationPhrase?: string;
|
|
204
204
|
onSuccess?: () => void;
|
|
205
|
-
}
|
|
205
|
+
};
|
|
206
206
|
/** Destructive settings screen for permanent account deletion; requires typing a confirmation phrase and password. */
|
|
207
207
|
declare function DeleteAccountScreen({ confirmationPhrase, onSuccess, }: DeleteAccountScreenProps): react_jsx_runtime.JSX.Element;
|
|
208
208
|
|
|
209
|
-
|
|
209
|
+
type SessionsScreenProps = {
|
|
210
210
|
onSuccess?: () => void;
|
|
211
|
-
}
|
|
211
|
+
};
|
|
212
212
|
/** Settings screen listing all active sessions with individual revoke and revoke-all-others actions. */
|
|
213
213
|
declare function SessionsScreen({ onSuccess }: SessionsScreenProps): react_jsx_runtime.JSX.Element;
|
|
214
214
|
|
|
215
|
-
|
|
215
|
+
type TwoFactorSettingsScreenProps = {
|
|
216
216
|
onSuccess?: () => void;
|
|
217
|
-
}
|
|
217
|
+
};
|
|
218
218
|
/** Settings screen for enabling or disabling TOTP two-factor authentication; shows the secret, verify step, and backup codes. */
|
|
219
219
|
declare function TwoFactorSettingsScreen({ onSuccess }: TwoFactorSettingsScreenProps): react_jsx_runtime.JSX.Element;
|
|
220
220
|
|
|
221
|
-
|
|
221
|
+
type UpdateAvatarScreenProps = {
|
|
222
222
|
onSuccess?: () => void;
|
|
223
|
-
}
|
|
223
|
+
};
|
|
224
224
|
/** Settings screen for uploading or removing the current user's avatar using the image library. */
|
|
225
225
|
declare function UpdateAvatarScreen({ onSuccess }: UpdateAvatarScreenProps): react_jsx_runtime.JSX.Element;
|
|
226
226
|
|
|
227
|
-
|
|
227
|
+
type UpdateNameScreenProps = {
|
|
228
228
|
onSuccess?: () => void;
|
|
229
|
-
}
|
|
229
|
+
};
|
|
230
230
|
/** Settings screen for updating the current user's display name. */
|
|
231
231
|
declare function UpdateNameScreen({ onSuccess }: UpdateNameScreenProps): react_jsx_runtime.JSX.Element;
|
|
232
232
|
|
|
233
|
-
|
|
233
|
+
type UpdateUsernameScreenProps = {
|
|
234
234
|
onSuccess?: () => void;
|
|
235
|
-
}
|
|
236
|
-
/** Settings screen for updating the account username with
|
|
235
|
+
};
|
|
236
|
+
/** Settings screen for updating the account username with server-side validation. */
|
|
237
237
|
declare function UpdateUsernameScreen({ onSuccess }: UpdateUsernameScreenProps): react_jsx_runtime.JSX.Element;
|
|
238
238
|
|
|
239
|
-
|
|
239
|
+
type OrganizationMembersScreenProps = {
|
|
240
240
|
organizationId: string;
|
|
241
241
|
isAdmin?: boolean;
|
|
242
242
|
onSuccess?: () => void;
|
|
243
|
-
}
|
|
243
|
+
};
|
|
244
244
|
/** Screen displaying organization members with role management and removal actions (admin only). */
|
|
245
245
|
declare function OrganizationMembersScreen({ organizationId, isAdmin, onSuccess, }: OrganizationMembersScreenProps): react_jsx_runtime.JSX.Element;
|
|
246
246
|
|
|
247
|
-
|
|
247
|
+
type OrganizationSwitcherScreenProps = {
|
|
248
248
|
currentOrgId?: string;
|
|
249
249
|
onSwitch?: (orgId: string) => void;
|
|
250
|
-
}
|
|
250
|
+
};
|
|
251
251
|
/** Screen listing all organizations the user belongs to; selecting one sets it as the active organization. */
|
|
252
252
|
declare function OrganizationSwitcherScreen({ currentOrgId, onSwitch, }: OrganizationSwitcherScreenProps): react_jsx_runtime.JSX.Element;
|
|
253
253
|
|
|
254
254
|
/**
|
|
255
255
|
* Returns the Better Auth client instance from the nearest `AuthProvider`.
|
|
256
256
|
*
|
|
257
|
-
* @throws {
|
|
257
|
+
* @throws {InvalidConfigError} If called outside of an `AuthProvider`.
|
|
258
258
|
* @returns The configured Better Auth client with expo plugin.
|
|
259
259
|
*/
|
|
260
|
-
declare function useAuthClient():
|
|
260
|
+
declare function useAuthClient(): {
|
|
261
|
+
signIn: {
|
|
262
|
+
social: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
263
|
+
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";
|
|
264
|
+
callbackURL?: string | undefined;
|
|
265
|
+
newUserCallbackURL?: string | undefined;
|
|
266
|
+
errorCallbackURL?: string | undefined;
|
|
267
|
+
disableRedirect?: boolean | undefined;
|
|
268
|
+
idToken?: {
|
|
269
|
+
token: string;
|
|
270
|
+
nonce?: string | undefined;
|
|
271
|
+
accessToken?: string | undefined;
|
|
272
|
+
refreshToken?: string | undefined;
|
|
273
|
+
expiresAt?: number | undefined;
|
|
274
|
+
user?: {
|
|
275
|
+
name?: {
|
|
276
|
+
firstName?: string | undefined;
|
|
277
|
+
lastName?: string | undefined;
|
|
278
|
+
} | undefined;
|
|
279
|
+
email?: string | undefined;
|
|
280
|
+
} | undefined;
|
|
281
|
+
} | undefined;
|
|
282
|
+
scopes?: string[] | undefined;
|
|
283
|
+
requestSignUp?: boolean | undefined;
|
|
284
|
+
loginHint?: string | undefined;
|
|
285
|
+
additionalData?: Record<string, any> | undefined;
|
|
286
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
287
|
+
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";
|
|
288
|
+
callbackURL?: string | undefined;
|
|
289
|
+
newUserCallbackURL?: string | undefined;
|
|
290
|
+
errorCallbackURL?: string | undefined;
|
|
291
|
+
disableRedirect?: boolean | undefined;
|
|
292
|
+
idToken?: {
|
|
293
|
+
token: string;
|
|
294
|
+
nonce?: string | undefined;
|
|
295
|
+
accessToken?: string | undefined;
|
|
296
|
+
refreshToken?: string | undefined;
|
|
297
|
+
expiresAt?: number | undefined;
|
|
298
|
+
user?: {
|
|
299
|
+
name?: {
|
|
300
|
+
firstName?: string | undefined;
|
|
301
|
+
lastName?: string | undefined;
|
|
302
|
+
} | undefined;
|
|
303
|
+
email?: string | undefined;
|
|
304
|
+
} | undefined;
|
|
305
|
+
} | undefined;
|
|
306
|
+
scopes?: string[] | undefined;
|
|
307
|
+
requestSignUp?: boolean | undefined;
|
|
308
|
+
loginHint?: string | undefined;
|
|
309
|
+
additionalData?: Record<string, any> | undefined;
|
|
310
|
+
} & {
|
|
311
|
+
fetchOptions?: FetchOptions | undefined;
|
|
312
|
+
}>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
313
|
+
redirect: boolean;
|
|
314
|
+
url: string;
|
|
315
|
+
} | (Omit<{
|
|
316
|
+
redirect: boolean;
|
|
317
|
+
token: string;
|
|
318
|
+
url: undefined;
|
|
319
|
+
user: {
|
|
320
|
+
id: string;
|
|
321
|
+
createdAt: Date;
|
|
322
|
+
updatedAt: Date;
|
|
323
|
+
email: string;
|
|
324
|
+
emailVerified: boolean;
|
|
325
|
+
name: string;
|
|
326
|
+
image?: string | null | undefined | undefined;
|
|
327
|
+
};
|
|
328
|
+
}, "user"> & {
|
|
329
|
+
user: better_auth.StripEmptyObjects<{
|
|
330
|
+
id: string;
|
|
331
|
+
createdAt: Date;
|
|
332
|
+
updatedAt: Date;
|
|
333
|
+
email: string;
|
|
334
|
+
emailVerified: boolean;
|
|
335
|
+
name: string;
|
|
336
|
+
image?: string | null | undefined;
|
|
337
|
+
}>;
|
|
338
|
+
}), {
|
|
339
|
+
code?: string | undefined;
|
|
340
|
+
message?: string | undefined;
|
|
341
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
342
|
+
};
|
|
343
|
+
} & {
|
|
344
|
+
signOut: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
|
|
345
|
+
query?: Record<string, any> | undefined;
|
|
346
|
+
fetchOptions?: FetchOptions | undefined;
|
|
347
|
+
}> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
348
|
+
success: boolean;
|
|
349
|
+
}, {
|
|
350
|
+
code?: string | undefined;
|
|
351
|
+
message?: string | undefined;
|
|
352
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
353
|
+
} & {
|
|
354
|
+
signUp: {
|
|
355
|
+
email: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
356
|
+
name: string;
|
|
357
|
+
email: string;
|
|
358
|
+
password: string;
|
|
359
|
+
image?: string | undefined;
|
|
360
|
+
callbackURL?: string | undefined;
|
|
361
|
+
rememberMe?: boolean | undefined;
|
|
362
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
363
|
+
email: string;
|
|
364
|
+
name: string;
|
|
365
|
+
password: string;
|
|
366
|
+
image?: string | undefined;
|
|
367
|
+
callbackURL?: string | undefined;
|
|
368
|
+
fetchOptions?: FetchOptions | undefined;
|
|
369
|
+
}>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<(Omit<{
|
|
370
|
+
token: null;
|
|
371
|
+
user: {
|
|
372
|
+
id: string;
|
|
373
|
+
createdAt: Date;
|
|
374
|
+
updatedAt: Date;
|
|
375
|
+
email: string;
|
|
376
|
+
emailVerified: boolean;
|
|
377
|
+
name: string;
|
|
378
|
+
image?: string | null | undefined | undefined;
|
|
379
|
+
};
|
|
380
|
+
}, "user"> & {
|
|
381
|
+
user: better_auth.StripEmptyObjects<{
|
|
382
|
+
id: string;
|
|
383
|
+
createdAt: Date;
|
|
384
|
+
updatedAt: Date;
|
|
385
|
+
email: string;
|
|
386
|
+
emailVerified: boolean;
|
|
387
|
+
name: string;
|
|
388
|
+
image?: string | null | undefined;
|
|
389
|
+
}>;
|
|
390
|
+
}) | (Omit<{
|
|
391
|
+
token: string;
|
|
392
|
+
user: {
|
|
393
|
+
id: string;
|
|
394
|
+
createdAt: Date;
|
|
395
|
+
updatedAt: Date;
|
|
396
|
+
email: string;
|
|
397
|
+
emailVerified: boolean;
|
|
398
|
+
name: string;
|
|
399
|
+
image?: string | null | undefined | undefined;
|
|
400
|
+
};
|
|
401
|
+
}, "user"> & {
|
|
402
|
+
user: better_auth.StripEmptyObjects<{
|
|
403
|
+
id: string;
|
|
404
|
+
createdAt: Date;
|
|
405
|
+
updatedAt: Date;
|
|
406
|
+
email: string;
|
|
407
|
+
emailVerified: boolean;
|
|
408
|
+
name: string;
|
|
409
|
+
image?: string | null | undefined;
|
|
410
|
+
}>;
|
|
411
|
+
}), {
|
|
412
|
+
code?: string | undefined;
|
|
413
|
+
message?: string | undefined;
|
|
414
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
415
|
+
};
|
|
416
|
+
} & {
|
|
417
|
+
signIn: {
|
|
418
|
+
email: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
419
|
+
email: string;
|
|
420
|
+
password: string;
|
|
421
|
+
callbackURL?: string | undefined;
|
|
422
|
+
rememberMe?: boolean | undefined;
|
|
423
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
424
|
+
email: string;
|
|
425
|
+
password: string;
|
|
426
|
+
callbackURL?: string | undefined;
|
|
427
|
+
rememberMe?: boolean | undefined;
|
|
428
|
+
} & {
|
|
429
|
+
fetchOptions?: FetchOptions | undefined;
|
|
430
|
+
}>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<Omit<{
|
|
431
|
+
redirect: boolean;
|
|
432
|
+
token: string;
|
|
433
|
+
url?: string | 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: better_auth.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
|
+
resetPassword: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
460
|
+
newPassword: string;
|
|
461
|
+
token?: string | undefined;
|
|
462
|
+
}> & Record<string, any>, Partial<{
|
|
463
|
+
token?: string | undefined;
|
|
464
|
+
}> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
465
|
+
newPassword: string;
|
|
466
|
+
token?: string | undefined;
|
|
467
|
+
} & {
|
|
468
|
+
fetchOptions?: FetchOptions | undefined;
|
|
469
|
+
}>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
470
|
+
status: boolean;
|
|
471
|
+
}, {
|
|
472
|
+
code?: string | undefined;
|
|
473
|
+
message?: string | undefined;
|
|
474
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
475
|
+
} & {
|
|
476
|
+
verifyEmail: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
|
|
477
|
+
token: string;
|
|
478
|
+
callbackURL?: string | undefined;
|
|
479
|
+
}> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
480
|
+
query: {
|
|
481
|
+
token: string;
|
|
482
|
+
callbackURL?: string | undefined;
|
|
483
|
+
};
|
|
484
|
+
fetchOptions?: FetchOptions | undefined;
|
|
485
|
+
}>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<NonNullable<void | {
|
|
486
|
+
status: boolean;
|
|
487
|
+
}>, {
|
|
488
|
+
code?: string | undefined;
|
|
489
|
+
message?: string | undefined;
|
|
490
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
491
|
+
} & {
|
|
492
|
+
sendVerificationEmail: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
493
|
+
email: string;
|
|
494
|
+
callbackURL?: string | undefined;
|
|
495
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
496
|
+
email: string;
|
|
497
|
+
callbackURL?: string | undefined;
|
|
498
|
+
} & {
|
|
499
|
+
fetchOptions?: FetchOptions | undefined;
|
|
500
|
+
}>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
501
|
+
status: boolean;
|
|
502
|
+
}, {
|
|
503
|
+
code?: string | undefined;
|
|
504
|
+
message?: string | undefined;
|
|
505
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
506
|
+
} & {
|
|
507
|
+
changeEmail: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
508
|
+
newEmail: string;
|
|
509
|
+
callbackURL?: string | undefined;
|
|
510
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
511
|
+
newEmail: string;
|
|
512
|
+
callbackURL?: string | undefined;
|
|
513
|
+
} & {
|
|
514
|
+
fetchOptions?: FetchOptions | undefined;
|
|
515
|
+
}>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
516
|
+
status: boolean;
|
|
517
|
+
}, {
|
|
518
|
+
code?: string | undefined;
|
|
519
|
+
message?: string | undefined;
|
|
520
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
521
|
+
} & {
|
|
522
|
+
changePassword: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
523
|
+
newPassword: string;
|
|
524
|
+
currentPassword: string;
|
|
525
|
+
revokeOtherSessions?: boolean | undefined;
|
|
526
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
527
|
+
newPassword: string;
|
|
528
|
+
currentPassword: string;
|
|
529
|
+
revokeOtherSessions?: boolean | undefined;
|
|
530
|
+
} & {
|
|
531
|
+
fetchOptions?: FetchOptions | undefined;
|
|
532
|
+
}>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<Omit<{
|
|
533
|
+
token: string | null;
|
|
534
|
+
user: {
|
|
535
|
+
id: string;
|
|
536
|
+
createdAt: Date;
|
|
537
|
+
updatedAt: Date;
|
|
538
|
+
email: string;
|
|
539
|
+
emailVerified: boolean;
|
|
540
|
+
name: string;
|
|
541
|
+
image?: string | null | undefined;
|
|
542
|
+
} & Record<string, any> & {
|
|
543
|
+
id: string;
|
|
544
|
+
createdAt: Date;
|
|
545
|
+
updatedAt: Date;
|
|
546
|
+
email: string;
|
|
547
|
+
emailVerified: boolean;
|
|
548
|
+
name: string;
|
|
549
|
+
image?: string | null | undefined;
|
|
550
|
+
};
|
|
551
|
+
}, "user"> & {
|
|
552
|
+
user: better_auth.StripEmptyObjects<{
|
|
553
|
+
id: string;
|
|
554
|
+
createdAt: Date;
|
|
555
|
+
updatedAt: Date;
|
|
556
|
+
email: string;
|
|
557
|
+
emailVerified: boolean;
|
|
558
|
+
name: string;
|
|
559
|
+
image?: string | null | undefined;
|
|
560
|
+
}>;
|
|
561
|
+
}, {
|
|
562
|
+
code?: string | undefined;
|
|
563
|
+
message?: string | undefined;
|
|
564
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
565
|
+
} & {
|
|
566
|
+
updateSession: <FetchOptions extends better_auth.ClientFetchOption<Partial<Partial<{}>> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<Partial<{}> & {
|
|
567
|
+
fetchOptions?: FetchOptions | undefined;
|
|
568
|
+
}> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
569
|
+
session: {
|
|
570
|
+
id: string;
|
|
571
|
+
createdAt: Date;
|
|
572
|
+
updatedAt: Date;
|
|
573
|
+
userId: string;
|
|
574
|
+
expiresAt: Date;
|
|
575
|
+
token: string;
|
|
576
|
+
ipAddress?: string | null | undefined;
|
|
577
|
+
userAgent?: string | null | undefined;
|
|
578
|
+
};
|
|
579
|
+
}, {
|
|
580
|
+
code?: string | undefined;
|
|
581
|
+
message?: string | undefined;
|
|
582
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
583
|
+
} & {
|
|
584
|
+
updateUser: <FetchOptions extends better_auth.ClientFetchOption<Partial<Partial<{}> & {
|
|
585
|
+
name?: string | undefined;
|
|
586
|
+
image?: string | undefined | null;
|
|
587
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<better_auth_client.InferUserUpdateCtx<better_auth.BetterAuthClientOptions, FetchOptions>> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
588
|
+
status: boolean;
|
|
589
|
+
}, {
|
|
590
|
+
code?: string | undefined;
|
|
591
|
+
message?: string | undefined;
|
|
592
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
593
|
+
} & {
|
|
594
|
+
deleteUser: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
595
|
+
callbackURL?: string | undefined;
|
|
596
|
+
password?: string | undefined;
|
|
597
|
+
token?: string | undefined;
|
|
598
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
|
|
599
|
+
callbackURL?: string | undefined;
|
|
600
|
+
password?: string | undefined;
|
|
601
|
+
token?: string | undefined;
|
|
602
|
+
} & {
|
|
603
|
+
fetchOptions?: FetchOptions | undefined;
|
|
604
|
+
}> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
605
|
+
success: boolean;
|
|
606
|
+
message: string;
|
|
607
|
+
}, {
|
|
608
|
+
code?: string | undefined;
|
|
609
|
+
message?: string | undefined;
|
|
610
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
611
|
+
} & {
|
|
612
|
+
requestPasswordReset: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
613
|
+
email: string;
|
|
614
|
+
redirectTo?: string | undefined;
|
|
615
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
616
|
+
email: string;
|
|
617
|
+
redirectTo?: string | undefined;
|
|
618
|
+
} & {
|
|
619
|
+
fetchOptions?: FetchOptions | undefined;
|
|
620
|
+
}>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
621
|
+
status: boolean;
|
|
622
|
+
message: string;
|
|
623
|
+
}, {
|
|
624
|
+
code?: string | undefined;
|
|
625
|
+
message?: string | undefined;
|
|
626
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
627
|
+
} & {
|
|
628
|
+
resetPassword: {
|
|
629
|
+
":token": <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
|
|
630
|
+
callbackURL: string;
|
|
631
|
+
}> & Record<string, any>, {
|
|
632
|
+
token: string;
|
|
633
|
+
}>>(data_0: better_auth.Prettify<{
|
|
634
|
+
query: {
|
|
635
|
+
callbackURL: string;
|
|
636
|
+
};
|
|
637
|
+
fetchOptions?: FetchOptions | undefined;
|
|
638
|
+
}>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<never, {
|
|
639
|
+
code?: string | undefined;
|
|
640
|
+
message?: string | undefined;
|
|
641
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
642
|
+
};
|
|
643
|
+
} & {
|
|
644
|
+
listSessions: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
|
|
645
|
+
query?: Record<string, any> | undefined;
|
|
646
|
+
fetchOptions?: FetchOptions | undefined;
|
|
647
|
+
}> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<better_auth.Prettify<{
|
|
648
|
+
id: string;
|
|
649
|
+
createdAt: Date;
|
|
650
|
+
updatedAt: Date;
|
|
651
|
+
userId: string;
|
|
652
|
+
expiresAt: Date;
|
|
653
|
+
token: string;
|
|
654
|
+
ipAddress?: string | null | undefined | undefined;
|
|
655
|
+
userAgent?: string | null | undefined | undefined;
|
|
656
|
+
}>[], {
|
|
657
|
+
code?: string | undefined;
|
|
658
|
+
message?: string | undefined;
|
|
659
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
660
|
+
} & {
|
|
661
|
+
revokeSession: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
662
|
+
token: string;
|
|
663
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
664
|
+
token: string;
|
|
665
|
+
} & {
|
|
666
|
+
fetchOptions?: FetchOptions | undefined;
|
|
667
|
+
}>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
668
|
+
status: boolean;
|
|
669
|
+
}, {
|
|
670
|
+
code?: string | undefined;
|
|
671
|
+
message?: string | undefined;
|
|
672
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
673
|
+
} & {
|
|
674
|
+
revokeSessions: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
|
|
675
|
+
query?: Record<string, any> | undefined;
|
|
676
|
+
fetchOptions?: FetchOptions | undefined;
|
|
677
|
+
}> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
678
|
+
status: boolean;
|
|
679
|
+
}, {
|
|
680
|
+
code?: string | undefined;
|
|
681
|
+
message?: string | undefined;
|
|
682
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
683
|
+
} & {
|
|
684
|
+
revokeOtherSessions: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
|
|
685
|
+
query?: Record<string, any> | undefined;
|
|
686
|
+
fetchOptions?: FetchOptions | undefined;
|
|
687
|
+
}> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
688
|
+
status: boolean;
|
|
689
|
+
}, {
|
|
690
|
+
code?: string | undefined;
|
|
691
|
+
message?: string | undefined;
|
|
692
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
693
|
+
} & {
|
|
694
|
+
linkSocial: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
695
|
+
provider: unknown;
|
|
696
|
+
callbackURL?: string | undefined;
|
|
697
|
+
idToken?: {
|
|
698
|
+
token: string;
|
|
699
|
+
nonce?: string | undefined;
|
|
700
|
+
accessToken?: string | undefined;
|
|
701
|
+
refreshToken?: string | undefined;
|
|
702
|
+
scopes?: string[] | undefined;
|
|
703
|
+
} | undefined;
|
|
704
|
+
requestSignUp?: boolean | undefined;
|
|
705
|
+
scopes?: string[] | undefined;
|
|
706
|
+
errorCallbackURL?: string | undefined;
|
|
707
|
+
disableRedirect?: boolean | undefined;
|
|
708
|
+
additionalData?: Record<string, any> | undefined;
|
|
709
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
710
|
+
provider: unknown;
|
|
711
|
+
callbackURL?: string | undefined;
|
|
712
|
+
idToken?: {
|
|
713
|
+
token: string;
|
|
714
|
+
nonce?: string | undefined;
|
|
715
|
+
accessToken?: string | undefined;
|
|
716
|
+
refreshToken?: string | undefined;
|
|
717
|
+
scopes?: string[] | undefined;
|
|
718
|
+
} | undefined;
|
|
719
|
+
requestSignUp?: boolean | undefined;
|
|
720
|
+
scopes?: string[] | undefined;
|
|
721
|
+
errorCallbackURL?: string | undefined;
|
|
722
|
+
disableRedirect?: boolean | undefined;
|
|
723
|
+
additionalData?: Record<string, any> | undefined;
|
|
724
|
+
} & {
|
|
725
|
+
fetchOptions?: FetchOptions | undefined;
|
|
726
|
+
}>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
727
|
+
url: string;
|
|
728
|
+
redirect: boolean;
|
|
729
|
+
}, {
|
|
730
|
+
code?: string | undefined;
|
|
731
|
+
message?: string | undefined;
|
|
732
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
733
|
+
} & {
|
|
734
|
+
listAccounts: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
|
|
735
|
+
query?: Record<string, any> | undefined;
|
|
736
|
+
fetchOptions?: FetchOptions | undefined;
|
|
737
|
+
}> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
738
|
+
scopes: string[];
|
|
739
|
+
id: string;
|
|
740
|
+
createdAt: Date;
|
|
741
|
+
updatedAt: Date;
|
|
742
|
+
userId: string;
|
|
743
|
+
providerId: string;
|
|
744
|
+
accountId: string;
|
|
745
|
+
}[], {
|
|
746
|
+
code?: string | undefined;
|
|
747
|
+
message?: string | undefined;
|
|
748
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
749
|
+
} & {
|
|
750
|
+
deleteUser: {
|
|
751
|
+
callback: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
|
|
752
|
+
token: string;
|
|
753
|
+
callbackURL?: string | undefined;
|
|
754
|
+
}> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
755
|
+
query: {
|
|
756
|
+
token: string;
|
|
757
|
+
callbackURL?: string | undefined;
|
|
758
|
+
};
|
|
759
|
+
fetchOptions?: FetchOptions | undefined;
|
|
760
|
+
}>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
761
|
+
success: boolean;
|
|
762
|
+
message: string;
|
|
763
|
+
}, {
|
|
764
|
+
code?: string | undefined;
|
|
765
|
+
message?: string | undefined;
|
|
766
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
767
|
+
};
|
|
768
|
+
} & {
|
|
769
|
+
unlinkAccount: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
770
|
+
providerId: string;
|
|
771
|
+
accountId?: string | undefined;
|
|
772
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
773
|
+
providerId: string;
|
|
774
|
+
accountId?: string | undefined;
|
|
775
|
+
} & {
|
|
776
|
+
fetchOptions?: FetchOptions | undefined;
|
|
777
|
+
}>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
778
|
+
status: boolean;
|
|
779
|
+
}, {
|
|
780
|
+
code?: string | undefined;
|
|
781
|
+
message?: string | undefined;
|
|
782
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
783
|
+
} & {
|
|
784
|
+
refreshToken: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
785
|
+
providerId: string;
|
|
786
|
+
accountId?: string | undefined;
|
|
787
|
+
userId?: string | undefined;
|
|
788
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
789
|
+
providerId: string;
|
|
790
|
+
accountId?: string | undefined;
|
|
791
|
+
userId?: string | undefined;
|
|
792
|
+
} & {
|
|
793
|
+
fetchOptions?: FetchOptions | undefined;
|
|
794
|
+
}>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
795
|
+
accessToken: string | undefined;
|
|
796
|
+
refreshToken: string;
|
|
797
|
+
accessTokenExpiresAt: Date | undefined;
|
|
798
|
+
refreshTokenExpiresAt: Date | null | undefined;
|
|
799
|
+
scope: string | null | undefined;
|
|
800
|
+
idToken: string | null | undefined;
|
|
801
|
+
providerId: string;
|
|
802
|
+
accountId: string;
|
|
803
|
+
}, {
|
|
804
|
+
code?: string | undefined;
|
|
805
|
+
message?: string | undefined;
|
|
806
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
807
|
+
} & {
|
|
808
|
+
getAccessToken: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
809
|
+
providerId: string;
|
|
810
|
+
accountId?: string | undefined;
|
|
811
|
+
userId?: string | undefined;
|
|
812
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
813
|
+
providerId: string;
|
|
814
|
+
accountId?: string | undefined;
|
|
815
|
+
userId?: string | undefined;
|
|
816
|
+
} & {
|
|
817
|
+
fetchOptions?: FetchOptions | undefined;
|
|
818
|
+
}>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
819
|
+
accessToken: string;
|
|
820
|
+
accessTokenExpiresAt: Date | undefined;
|
|
821
|
+
scopes: string[];
|
|
822
|
+
idToken: string | undefined;
|
|
823
|
+
}, {
|
|
824
|
+
code?: string | undefined;
|
|
825
|
+
message?: string | undefined;
|
|
826
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
827
|
+
} & {
|
|
828
|
+
accountInfo: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
|
|
829
|
+
accountId?: string | undefined;
|
|
830
|
+
}> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
|
|
831
|
+
query?: {
|
|
832
|
+
accountId?: string | undefined;
|
|
833
|
+
} | undefined;
|
|
834
|
+
fetchOptions?: FetchOptions | undefined;
|
|
835
|
+
}> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
836
|
+
user: better_auth.OAuth2UserInfo;
|
|
837
|
+
data: Record<string, any>;
|
|
838
|
+
}, {
|
|
839
|
+
code?: string | undefined;
|
|
840
|
+
message?: string | undefined;
|
|
841
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
842
|
+
} & {
|
|
843
|
+
getSession: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
|
|
844
|
+
disableCookieCache?: unknown;
|
|
845
|
+
disableRefresh?: unknown;
|
|
846
|
+
}> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
|
|
847
|
+
query?: {
|
|
848
|
+
disableCookieCache?: unknown;
|
|
849
|
+
disableRefresh?: unknown;
|
|
850
|
+
} | undefined;
|
|
851
|
+
fetchOptions?: FetchOptions | undefined;
|
|
852
|
+
}> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
853
|
+
user: better_auth.StripEmptyObjects<{
|
|
854
|
+
id: string;
|
|
855
|
+
createdAt: Date;
|
|
856
|
+
updatedAt: Date;
|
|
857
|
+
email: string;
|
|
858
|
+
emailVerified: boolean;
|
|
859
|
+
name: string;
|
|
860
|
+
image?: string | null | undefined;
|
|
861
|
+
}>;
|
|
862
|
+
session: better_auth.StripEmptyObjects<{
|
|
863
|
+
id: string;
|
|
864
|
+
createdAt: Date;
|
|
865
|
+
updatedAt: Date;
|
|
866
|
+
userId: string;
|
|
867
|
+
expiresAt: Date;
|
|
868
|
+
token: string;
|
|
869
|
+
ipAddress?: string | null | undefined;
|
|
870
|
+
userAgent?: string | null | undefined;
|
|
871
|
+
}>;
|
|
872
|
+
} | null, {
|
|
873
|
+
code?: string | undefined;
|
|
874
|
+
message?: string | undefined;
|
|
875
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
876
|
+
} & {
|
|
877
|
+
useSession: () => {
|
|
878
|
+
data: {
|
|
879
|
+
user: better_auth.StripEmptyObjects<{
|
|
880
|
+
id: string;
|
|
881
|
+
createdAt: Date;
|
|
882
|
+
updatedAt: Date;
|
|
883
|
+
email: string;
|
|
884
|
+
emailVerified: boolean;
|
|
885
|
+
name: string;
|
|
886
|
+
image?: string | null | undefined;
|
|
887
|
+
}>;
|
|
888
|
+
session: better_auth.StripEmptyObjects<{
|
|
889
|
+
id: string;
|
|
890
|
+
createdAt: Date;
|
|
891
|
+
updatedAt: Date;
|
|
892
|
+
userId: string;
|
|
893
|
+
expiresAt: Date;
|
|
894
|
+
token: string;
|
|
895
|
+
ipAddress?: string | null | undefined;
|
|
896
|
+
userAgent?: string | null | undefined;
|
|
897
|
+
}>;
|
|
898
|
+
} | null;
|
|
899
|
+
isPending: boolean;
|
|
900
|
+
isRefetching: boolean;
|
|
901
|
+
error: better_auth_client.BetterFetchError | null;
|
|
902
|
+
refetch: (queryParams?: {
|
|
903
|
+
query?: better_auth.SessionQueryParams;
|
|
904
|
+
} | undefined) => Promise<void>;
|
|
905
|
+
};
|
|
906
|
+
$Infer: {
|
|
907
|
+
Session: {
|
|
908
|
+
user: better_auth.StripEmptyObjects<{
|
|
909
|
+
id: string;
|
|
910
|
+
createdAt: Date;
|
|
911
|
+
updatedAt: Date;
|
|
912
|
+
email: string;
|
|
913
|
+
emailVerified: boolean;
|
|
914
|
+
name: string;
|
|
915
|
+
image?: string | null | undefined;
|
|
916
|
+
}>;
|
|
917
|
+
session: better_auth.StripEmptyObjects<{
|
|
918
|
+
id: string;
|
|
919
|
+
createdAt: Date;
|
|
920
|
+
updatedAt: Date;
|
|
921
|
+
userId: string;
|
|
922
|
+
expiresAt: Date;
|
|
923
|
+
token: string;
|
|
924
|
+
ipAddress?: string | null | undefined;
|
|
925
|
+
userAgent?: string | null | undefined;
|
|
926
|
+
}>;
|
|
927
|
+
};
|
|
928
|
+
};
|
|
929
|
+
$fetch: better_auth_client.BetterFetch<{
|
|
930
|
+
plugins: (better_auth_client.BetterFetchPlugin<Record<string, any>> | {
|
|
931
|
+
id: string;
|
|
932
|
+
name: string;
|
|
933
|
+
hooks: {
|
|
934
|
+
onSuccess(context: better_auth_client.SuccessContext<any>): void;
|
|
935
|
+
};
|
|
936
|
+
} | {
|
|
937
|
+
id: string;
|
|
938
|
+
name: string;
|
|
939
|
+
hooks: {
|
|
940
|
+
onSuccess: ((context: better_auth_client.SuccessContext<any>) => Promise<void> | void) | undefined;
|
|
941
|
+
onError: ((context: better_auth_client.ErrorContext) => Promise<void> | void) | undefined;
|
|
942
|
+
onRequest: (<T extends Record<string, any>>(context: better_auth_client.RequestContext<T>) => Promise<better_auth_client.RequestContext | void> | better_auth_client.RequestContext | void) | undefined;
|
|
943
|
+
onResponse: ((context: better_auth_client.ResponseContext) => Promise<Response | void | better_auth_client.ResponseContext> | Response | better_auth_client.ResponseContext | void) | undefined;
|
|
944
|
+
};
|
|
945
|
+
})[];
|
|
946
|
+
cache?: RequestCache | undefined;
|
|
947
|
+
priority?: RequestPriority | undefined;
|
|
948
|
+
credentials?: RequestCredentials;
|
|
949
|
+
headers?: (HeadersInit & (HeadersInit | {
|
|
950
|
+
accept: "application/json" | "text/plain" | "application/octet-stream";
|
|
951
|
+
"content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
|
|
952
|
+
authorization: "Bearer" | "Basic";
|
|
953
|
+
})) | undefined;
|
|
954
|
+
integrity?: string | undefined;
|
|
955
|
+
keepalive?: boolean | undefined;
|
|
956
|
+
method: string;
|
|
957
|
+
mode?: RequestMode | undefined;
|
|
958
|
+
redirect?: RequestRedirect | undefined;
|
|
959
|
+
referrer?: string | undefined;
|
|
960
|
+
referrerPolicy?: ReferrerPolicy | undefined;
|
|
961
|
+
signal?: (AbortSignal | null) | undefined;
|
|
962
|
+
window?: null | undefined;
|
|
963
|
+
onRetry?: ((response: better_auth_client.ResponseContext) => Promise<void> | void) | undefined;
|
|
964
|
+
hookOptions?: {
|
|
965
|
+
cloneResponse?: boolean;
|
|
966
|
+
} | undefined;
|
|
967
|
+
timeout?: number | undefined;
|
|
968
|
+
customFetchImpl: better_auth_client.FetchEsque;
|
|
969
|
+
baseURL: string;
|
|
970
|
+
throw?: boolean | undefined;
|
|
971
|
+
auth?: ({
|
|
972
|
+
type: "Bearer";
|
|
973
|
+
token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
|
|
974
|
+
} | {
|
|
975
|
+
type: "Basic";
|
|
976
|
+
username: string | (() => string | undefined) | undefined;
|
|
977
|
+
password: string | (() => string | undefined) | undefined;
|
|
978
|
+
} | {
|
|
979
|
+
type: "Custom";
|
|
980
|
+
prefix: string | (() => string | undefined) | undefined;
|
|
981
|
+
value: string | (() => string | undefined) | undefined;
|
|
982
|
+
}) | undefined;
|
|
983
|
+
body?: any;
|
|
984
|
+
query?: any;
|
|
985
|
+
params?: any;
|
|
986
|
+
duplex?: "full" | "half" | undefined;
|
|
987
|
+
jsonParser: (text: string) => Promise<any> | any;
|
|
988
|
+
retry?: better_auth_client.RetryOptions | undefined;
|
|
989
|
+
retryAttempt?: number | undefined;
|
|
990
|
+
output?: (better_auth_client.StandardSchemaV1 | typeof Blob | typeof File) | undefined;
|
|
991
|
+
errorSchema?: better_auth_client.StandardSchemaV1 | undefined;
|
|
992
|
+
disableValidation?: boolean | undefined;
|
|
993
|
+
disableSignal?: boolean | undefined;
|
|
994
|
+
}, unknown, unknown, {}>;
|
|
995
|
+
$store: {
|
|
996
|
+
notify: (signal?: (Omit<string, "$sessionSignal"> | "$sessionSignal") | undefined) => void;
|
|
997
|
+
listen: (signal: Omit<string, "$sessionSignal"> | "$sessionSignal", listener: (value: boolean, oldValue?: boolean | undefined) => void) => void;
|
|
998
|
+
atoms: Record<string, better_auth_client.WritableAtom<any>>;
|
|
999
|
+
};
|
|
1000
|
+
$ERROR_CODES: {
|
|
1001
|
+
USER_NOT_FOUND: better_auth.RawError<"USER_NOT_FOUND">;
|
|
1002
|
+
FAILED_TO_CREATE_USER: better_auth.RawError<"FAILED_TO_CREATE_USER">;
|
|
1003
|
+
FAILED_TO_CREATE_SESSION: better_auth.RawError<"FAILED_TO_CREATE_SESSION">;
|
|
1004
|
+
FAILED_TO_UPDATE_USER: better_auth.RawError<"FAILED_TO_UPDATE_USER">;
|
|
1005
|
+
FAILED_TO_GET_SESSION: better_auth.RawError<"FAILED_TO_GET_SESSION">;
|
|
1006
|
+
INVALID_PASSWORD: better_auth.RawError<"INVALID_PASSWORD">;
|
|
1007
|
+
INVALID_EMAIL: better_auth.RawError<"INVALID_EMAIL">;
|
|
1008
|
+
INVALID_EMAIL_OR_PASSWORD: better_auth.RawError<"INVALID_EMAIL_OR_PASSWORD">;
|
|
1009
|
+
INVALID_USER: better_auth.RawError<"INVALID_USER">;
|
|
1010
|
+
SOCIAL_ACCOUNT_ALREADY_LINKED: better_auth.RawError<"SOCIAL_ACCOUNT_ALREADY_LINKED">;
|
|
1011
|
+
PROVIDER_NOT_FOUND: better_auth.RawError<"PROVIDER_NOT_FOUND">;
|
|
1012
|
+
INVALID_TOKEN: better_auth.RawError<"INVALID_TOKEN">;
|
|
1013
|
+
TOKEN_EXPIRED: better_auth.RawError<"TOKEN_EXPIRED">;
|
|
1014
|
+
ID_TOKEN_NOT_SUPPORTED: better_auth.RawError<"ID_TOKEN_NOT_SUPPORTED">;
|
|
1015
|
+
FAILED_TO_GET_USER_INFO: better_auth.RawError<"FAILED_TO_GET_USER_INFO">;
|
|
1016
|
+
USER_EMAIL_NOT_FOUND: better_auth.RawError<"USER_EMAIL_NOT_FOUND">;
|
|
1017
|
+
EMAIL_NOT_VERIFIED: better_auth.RawError<"EMAIL_NOT_VERIFIED">;
|
|
1018
|
+
PASSWORD_TOO_SHORT: better_auth.RawError<"PASSWORD_TOO_SHORT">;
|
|
1019
|
+
PASSWORD_TOO_LONG: better_auth.RawError<"PASSWORD_TOO_LONG">;
|
|
1020
|
+
USER_ALREADY_EXISTS: better_auth.RawError<"USER_ALREADY_EXISTS">;
|
|
1021
|
+
USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL: better_auth.RawError<"USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL">;
|
|
1022
|
+
EMAIL_CAN_NOT_BE_UPDATED: better_auth.RawError<"EMAIL_CAN_NOT_BE_UPDATED">;
|
|
1023
|
+
CREDENTIAL_ACCOUNT_NOT_FOUND: better_auth.RawError<"CREDENTIAL_ACCOUNT_NOT_FOUND">;
|
|
1024
|
+
ACCOUNT_NOT_FOUND: better_auth.RawError<"ACCOUNT_NOT_FOUND">;
|
|
1025
|
+
SESSION_EXPIRED: better_auth.RawError<"SESSION_EXPIRED">;
|
|
1026
|
+
FAILED_TO_UNLINK_LAST_ACCOUNT: better_auth.RawError<"FAILED_TO_UNLINK_LAST_ACCOUNT">;
|
|
1027
|
+
USER_ALREADY_HAS_PASSWORD: better_auth.RawError<"USER_ALREADY_HAS_PASSWORD">;
|
|
1028
|
+
CROSS_SITE_NAVIGATION_LOGIN_BLOCKED: better_auth.RawError<"CROSS_SITE_NAVIGATION_LOGIN_BLOCKED">;
|
|
1029
|
+
VERIFICATION_EMAIL_NOT_ENABLED: better_auth.RawError<"VERIFICATION_EMAIL_NOT_ENABLED">;
|
|
1030
|
+
EMAIL_ALREADY_VERIFIED: better_auth.RawError<"EMAIL_ALREADY_VERIFIED">;
|
|
1031
|
+
EMAIL_MISMATCH: better_auth.RawError<"EMAIL_MISMATCH">;
|
|
1032
|
+
SESSION_NOT_FRESH: better_auth.RawError<"SESSION_NOT_FRESH">;
|
|
1033
|
+
LINKED_ACCOUNT_ALREADY_EXISTS: better_auth.RawError<"LINKED_ACCOUNT_ALREADY_EXISTS">;
|
|
1034
|
+
INVALID_ORIGIN: better_auth.RawError<"INVALID_ORIGIN">;
|
|
1035
|
+
INVALID_CALLBACK_URL: better_auth.RawError<"INVALID_CALLBACK_URL">;
|
|
1036
|
+
INVALID_REDIRECT_URL: better_auth.RawError<"INVALID_REDIRECT_URL">;
|
|
1037
|
+
INVALID_ERROR_CALLBACK_URL: better_auth.RawError<"INVALID_ERROR_CALLBACK_URL">;
|
|
1038
|
+
INVALID_NEW_USER_CALLBACK_URL: better_auth.RawError<"INVALID_NEW_USER_CALLBACK_URL">;
|
|
1039
|
+
MISSING_OR_NULL_ORIGIN: better_auth.RawError<"MISSING_OR_NULL_ORIGIN">;
|
|
1040
|
+
CALLBACK_URL_REQUIRED: better_auth.RawError<"CALLBACK_URL_REQUIRED">;
|
|
1041
|
+
FAILED_TO_CREATE_VERIFICATION: better_auth.RawError<"FAILED_TO_CREATE_VERIFICATION">;
|
|
1042
|
+
FIELD_NOT_ALLOWED: better_auth.RawError<"FIELD_NOT_ALLOWED">;
|
|
1043
|
+
ASYNC_VALIDATION_NOT_SUPPORTED: better_auth.RawError<"ASYNC_VALIDATION_NOT_SUPPORTED">;
|
|
1044
|
+
VALIDATION_ERROR: better_auth.RawError<"VALIDATION_ERROR">;
|
|
1045
|
+
MISSING_FIELD: better_auth.RawError<"MISSING_FIELD">;
|
|
1046
|
+
METHOD_NOT_ALLOWED_DEFER_SESSION_REQUIRED: better_auth.RawError<"METHOD_NOT_ALLOWED_DEFER_SESSION_REQUIRED">;
|
|
1047
|
+
BODY_MUST_BE_AN_OBJECT: better_auth.RawError<"BODY_MUST_BE_AN_OBJECT">;
|
|
1048
|
+
PASSWORD_ALREADY_SET: better_auth.RawError<"PASSWORD_ALREADY_SET">;
|
|
1049
|
+
};
|
|
1050
|
+
};
|
|
261
1051
|
|
|
262
1052
|
/**
|
|
263
1053
|
* Returns the resolved auth localization strings and the `localizeErrors` flag
|
|
@@ -275,11 +1065,11 @@ declare function useAuthRedirect(): {
|
|
|
275
1065
|
redirectToSignUp: (returnUrl?: string) => void;
|
|
276
1066
|
};
|
|
277
1067
|
|
|
278
|
-
|
|
1068
|
+
type BiometricAvailability = {
|
|
279
1069
|
hasHardware: boolean;
|
|
280
1070
|
isEnrolled: boolean;
|
|
281
1071
|
supportedTypes: number[];
|
|
282
|
-
}
|
|
1072
|
+
};
|
|
283
1073
|
/**
|
|
284
1074
|
* Hook for biometric authentication (Face ID / Touch ID / fingerprint).
|
|
285
1075
|
*
|
|
@@ -299,15 +1089,14 @@ interface BiometricAvailability {
|
|
|
299
1089
|
declare function useBiometric(): {
|
|
300
1090
|
checkAvailability: () => Promise<BiometricAvailability>;
|
|
301
1091
|
authenticate: _tanstack_react_query.UseMutationResult<{
|
|
302
|
-
success:
|
|
303
|
-
error?: string;
|
|
1092
|
+
success: true;
|
|
304
1093
|
}, Error, string, unknown>;
|
|
305
1094
|
};
|
|
306
1095
|
|
|
307
|
-
|
|
1096
|
+
type LoginInput = {
|
|
308
1097
|
email: string;
|
|
309
1098
|
password: string;
|
|
310
|
-
}
|
|
1099
|
+
};
|
|
311
1100
|
/**
|
|
312
1101
|
* Mutation hook for email/password login.
|
|
313
1102
|
*
|
|
@@ -316,7 +1105,30 @@ interface LoginInput {
|
|
|
316
1105
|
*
|
|
317
1106
|
* @returns A TanStack `UseMutationResult` — call `.mutate({ email, password })` to sign in.
|
|
318
1107
|
*/
|
|
319
|
-
declare function useLogin(): _tanstack_react_query.UseMutationResult<
|
|
1108
|
+
declare function useLogin(): _tanstack_react_query.UseMutationResult<Omit<{
|
|
1109
|
+
redirect: boolean;
|
|
1110
|
+
token: string;
|
|
1111
|
+
url?: string | undefined;
|
|
1112
|
+
user: {
|
|
1113
|
+
id: string;
|
|
1114
|
+
createdAt: Date;
|
|
1115
|
+
updatedAt: Date;
|
|
1116
|
+
email: string;
|
|
1117
|
+
emailVerified: boolean;
|
|
1118
|
+
name: string;
|
|
1119
|
+
image?: string | null | undefined | undefined;
|
|
1120
|
+
};
|
|
1121
|
+
}, "user"> & {
|
|
1122
|
+
user: better_auth.StripEmptyObjects<{
|
|
1123
|
+
id: string;
|
|
1124
|
+
createdAt: Date;
|
|
1125
|
+
updatedAt: Date;
|
|
1126
|
+
email: string;
|
|
1127
|
+
emailVerified: boolean;
|
|
1128
|
+
name: string;
|
|
1129
|
+
image?: string | null | undefined;
|
|
1130
|
+
}>;
|
|
1131
|
+
}, Error, LoginInput, unknown>;
|
|
320
1132
|
|
|
321
1133
|
/**
|
|
322
1134
|
* Mutation hook for signing out the current user.
|
|
@@ -326,31 +1138,33 @@ declare function useLogin(): _tanstack_react_query.UseMutationResult<any, Error,
|
|
|
326
1138
|
*
|
|
327
1139
|
* @returns A TanStack `UseMutationResult` — call `.mutate()` with no arguments to sign out.
|
|
328
1140
|
*/
|
|
329
|
-
declare function useLogout(): _tanstack_react_query.UseMutationResult<
|
|
1141
|
+
declare function useLogout(): _tanstack_react_query.UseMutationResult<{
|
|
1142
|
+
success: boolean;
|
|
1143
|
+
}, Error, void, unknown>;
|
|
330
1144
|
|
|
331
|
-
|
|
1145
|
+
type RequestPasswordResetInput = {
|
|
332
1146
|
email: string;
|
|
333
1147
|
redirectTo?: string;
|
|
334
|
-
}
|
|
1148
|
+
};
|
|
335
1149
|
/**
|
|
336
1150
|
* Mutation hook for requesting a password reset email.
|
|
337
1151
|
*/
|
|
338
1152
|
declare function useRequestPasswordReset(): _tanstack_react_query.UseMutationResult<boolean, Error, RequestPasswordResetInput, unknown>;
|
|
339
1153
|
|
|
340
|
-
|
|
1154
|
+
type ResetPasswordInput = {
|
|
341
1155
|
newPassword: string;
|
|
342
1156
|
token: string;
|
|
343
|
-
}
|
|
1157
|
+
};
|
|
344
1158
|
/**
|
|
345
1159
|
* Mutation hook for resetting a password using a token from the reset email.
|
|
346
1160
|
*/
|
|
347
1161
|
declare function useResetPassword(): _tanstack_react_query.UseMutationResult<boolean, Error, ResetPasswordInput, unknown>;
|
|
348
1162
|
|
|
349
|
-
|
|
1163
|
+
type SignupInput = {
|
|
350
1164
|
email: string;
|
|
351
1165
|
name: string;
|
|
352
1166
|
password: string;
|
|
353
|
-
}
|
|
1167
|
+
};
|
|
354
1168
|
/**
|
|
355
1169
|
* Mutation hook for email/password signup.
|
|
356
1170
|
*
|
|
@@ -359,7 +1173,49 @@ interface SignupInput {
|
|
|
359
1173
|
*
|
|
360
1174
|
* @returns A TanStack `UseMutationResult` — call `.mutate({ email, name, password })` to register.
|
|
361
1175
|
*/
|
|
362
|
-
declare function useSignup(): _tanstack_react_query.UseMutationResult<
|
|
1176
|
+
declare function useSignup(): _tanstack_react_query.UseMutationResult<(Omit<{
|
|
1177
|
+
token: null;
|
|
1178
|
+
user: {
|
|
1179
|
+
id: string;
|
|
1180
|
+
createdAt: Date;
|
|
1181
|
+
updatedAt: Date;
|
|
1182
|
+
email: string;
|
|
1183
|
+
emailVerified: boolean;
|
|
1184
|
+
name: string;
|
|
1185
|
+
image?: string | null | undefined | undefined;
|
|
1186
|
+
};
|
|
1187
|
+
}, "user"> & {
|
|
1188
|
+
user: better_auth.StripEmptyObjects<{
|
|
1189
|
+
id: string;
|
|
1190
|
+
createdAt: Date;
|
|
1191
|
+
updatedAt: Date;
|
|
1192
|
+
email: string;
|
|
1193
|
+
emailVerified: boolean;
|
|
1194
|
+
name: string;
|
|
1195
|
+
image?: string | null | undefined;
|
|
1196
|
+
}>;
|
|
1197
|
+
}) | (Omit<{
|
|
1198
|
+
token: string;
|
|
1199
|
+
user: {
|
|
1200
|
+
id: string;
|
|
1201
|
+
createdAt: Date;
|
|
1202
|
+
updatedAt: Date;
|
|
1203
|
+
email: string;
|
|
1204
|
+
emailVerified: boolean;
|
|
1205
|
+
name: string;
|
|
1206
|
+
image?: string | null | undefined | undefined;
|
|
1207
|
+
};
|
|
1208
|
+
}, "user"> & {
|
|
1209
|
+
user: better_auth.StripEmptyObjects<{
|
|
1210
|
+
id: string;
|
|
1211
|
+
createdAt: Date;
|
|
1212
|
+
updatedAt: Date;
|
|
1213
|
+
email: string;
|
|
1214
|
+
emailVerified: boolean;
|
|
1215
|
+
name: string;
|
|
1216
|
+
image?: string | null | undefined;
|
|
1217
|
+
}>;
|
|
1218
|
+
}), Error, SignupInput, unknown>;
|
|
363
1219
|
|
|
364
1220
|
/**
|
|
365
1221
|
* Query hook for the current session.
|
|
@@ -369,7 +1225,16 @@ declare function useSignup(): _tanstack_react_query.UseMutationResult<any, Error
|
|
|
369
1225
|
*
|
|
370
1226
|
* @returns A TanStack `UseQueryResult<Session | null>`.
|
|
371
1227
|
*/
|
|
372
|
-
declare function useSession(): _tanstack_react_query.UseQueryResult<
|
|
1228
|
+
declare function useSession(): _tanstack_react_query.UseQueryResult<better_auth.StripEmptyObjects<{
|
|
1229
|
+
id: string;
|
|
1230
|
+
createdAt: Date;
|
|
1231
|
+
updatedAt: Date;
|
|
1232
|
+
userId: string;
|
|
1233
|
+
expiresAt: Date;
|
|
1234
|
+
token: string;
|
|
1235
|
+
ipAddress?: string | null | undefined;
|
|
1236
|
+
userAgent?: string | null | undefined;
|
|
1237
|
+
}> | null, Error>;
|
|
373
1238
|
|
|
374
1239
|
/**
|
|
375
1240
|
* Query hook for the current authenticated user.
|
|
@@ -379,46 +1244,26 @@ declare function useSession(): _tanstack_react_query.UseQueryResult<any, Error>;
|
|
|
379
1244
|
*
|
|
380
1245
|
* @returns A TanStack `UseQueryResult<User | null>`.
|
|
381
1246
|
*/
|
|
382
|
-
declare function useUser(): _tanstack_react_query.UseQueryResult<
|
|
1247
|
+
declare function useUser(): _tanstack_react_query.UseQueryResult<better_auth.StripEmptyObjects<{
|
|
1248
|
+
id: string;
|
|
1249
|
+
createdAt: Date;
|
|
1250
|
+
updatedAt: Date;
|
|
1251
|
+
email: string;
|
|
1252
|
+
emailVerified: boolean;
|
|
1253
|
+
name: string;
|
|
1254
|
+
image?: string | null | undefined;
|
|
1255
|
+
}> | null, Error>;
|
|
383
1256
|
|
|
384
|
-
|
|
1257
|
+
type AuthProviderProps = {
|
|
385
1258
|
baseURL: string;
|
|
386
|
-
children:
|
|
1259
|
+
children: react__default.ReactNode;
|
|
387
1260
|
locales?: Record<string, AuthLocalization>;
|
|
388
1261
|
localization?: Partial<AuthLocalization>;
|
|
389
1262
|
queryClient?: QueryClient;
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
* Wraps Better Auth client with SecureStore for token persistence and
|
|
395
|
-
* expo-localization for automatic language detection.
|
|
396
|
-
*
|
|
397
|
-
* @param props - Provider configuration
|
|
398
|
-
* @param props.baseURL - Base URL of the Better Auth server
|
|
399
|
-
* @param props.children - Child components
|
|
400
|
-
* @param props.locales - Language packs keyed by BCP 47 language code (e.g. `{ el, de }`)
|
|
401
|
-
* @param props.localization - Per-key overrides applied on top of the resolved locale
|
|
402
|
-
* @param props.queryClient - Optional external TanStack QueryClient; a default one is created if omitted
|
|
403
|
-
* @returns JSX element wrapping children with auth, localization, and query contexts
|
|
404
|
-
*
|
|
405
|
-
* @example
|
|
406
|
-
* ```tsx
|
|
407
|
-
* import { el, de } from "@atzentis/auth-locales";
|
|
408
|
-
*
|
|
409
|
-
* export default function RootLayout() {
|
|
410
|
-
* return (
|
|
411
|
-
* <AuthProvider
|
|
412
|
-
* baseURL="https://auth.example.com"
|
|
413
|
-
* locales={{ el, de }}
|
|
414
|
-
* >
|
|
415
|
-
* <Slot />
|
|
416
|
-
* </AuthProvider>
|
|
417
|
-
* );
|
|
418
|
-
* }
|
|
419
|
-
* ```
|
|
420
|
-
*/
|
|
421
|
-
declare function AuthProvider({ baseURL, children, locales, localization: localizationOverride, queryClient: externalQueryClient, }: AuthProviderProps): react_jsx_runtime.JSX.Element;
|
|
1263
|
+
scheme: string;
|
|
1264
|
+
storagePrefix?: string;
|
|
1265
|
+
};
|
|
1266
|
+
declare function AuthProvider({ baseURL, children, locales, localization: localizationOverride, queryClient: externalQueryClient, scheme, storagePrefix, }: AuthProviderProps): react_jsx_runtime.JSX.Element;
|
|
422
1267
|
|
|
423
1268
|
/**
|
|
424
1269
|
* @atzentis/auth-expo - React Native/Expo integration for Atzentis Auth SDK
|