@atzentis/auth-expo 0.0.16 → 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 +54 -0
- package/LICENSE +1 -1
- package/README.md +195 -31
- package/dist/index.d.ts +1270 -9
- package/dist/index.js +2660 -2
- package/dist/index.js.map +1 -1
- package/package.json +64 -10
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,1274 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as react from 'react';
|
|
3
|
+
import react__default, { ReactNode } from 'react';
|
|
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';
|
|
7
|
+
import * as _atzentis_auth_locales from '@atzentis/auth-locales';
|
|
8
|
+
import { AuthLocalization } from '@atzentis/auth-locales';
|
|
9
|
+
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
10
|
+
import { QueryClient } from '@tanstack/react-query';
|
|
11
|
+
|
|
12
|
+
type AuthContainerProps = {
|
|
13
|
+
children: ReactNode;
|
|
14
|
+
};
|
|
1
15
|
/**
|
|
2
|
-
*
|
|
16
|
+
* Root layout for auth screens. Handles keyboard avoidance, safe area insets,
|
|
17
|
+
* and centering content on tablets.
|
|
18
|
+
*/
|
|
19
|
+
declare function AuthContainer({ children }: AuthContainerProps): react_jsx_runtime.JSX.Element;
|
|
20
|
+
|
|
21
|
+
type AuthGateProps = {
|
|
22
|
+
children: ReactNode;
|
|
23
|
+
fallback?: ReactNode;
|
|
24
|
+
};
|
|
25
|
+
declare function AuthGate({ children, fallback }: AuthGateProps): react_jsx_runtime.JSX.Element;
|
|
26
|
+
|
|
27
|
+
type ErrorFeedbackProps = {
|
|
28
|
+
message: string;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Displays an error message with a red alert icon.
|
|
32
|
+
* Used in auth screens to show validation or API errors.
|
|
33
|
+
*/
|
|
34
|
+
declare function ErrorFeedback({ message }: ErrorFeedbackProps): react_jsx_runtime.JSX.Element;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Form text input with optional label and error display.
|
|
38
|
+
* Designed for react-hook-form Controller render prop.
|
|
39
|
+
*/
|
|
40
|
+
declare const FormInput: react.ForwardRefExoticComponent<Omit<TextInputProps, "value" | "onChangeText"> & {
|
|
41
|
+
error?: string;
|
|
42
|
+
label?: string;
|
|
43
|
+
onChangeText?: (text: string) => void;
|
|
44
|
+
value?: string;
|
|
45
|
+
} & react.RefAttributes<TextInput>>;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Form password input with show/hide toggle, optional label and error display.
|
|
49
|
+
* Designed for react-hook-form Controller render prop.
|
|
50
|
+
*/
|
|
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>>;
|
|
57
|
+
|
|
58
|
+
type OAuthProvider = "google" | "apple" | "github";
|
|
59
|
+
type OAuthButtonProps = {
|
|
60
|
+
onError?: (error: Error) => void;
|
|
61
|
+
onSuccess?: () => void;
|
|
62
|
+
provider: OAuthProvider;
|
|
63
|
+
};
|
|
64
|
+
declare function OAuthButton({ onError, onSuccess, provider }: OAuthButtonProps): react_jsx_runtime.JSX.Element;
|
|
65
|
+
|
|
66
|
+
type ProtectedScreenProps = {
|
|
67
|
+
children: ReactNode;
|
|
68
|
+
fallback?: ReactNode;
|
|
69
|
+
};
|
|
70
|
+
declare function ProtectedScreen({ children, fallback }: ProtectedScreenProps): react_jsx_runtime.JSX.Element | null;
|
|
71
|
+
|
|
72
|
+
type SuccessFeedbackProps = {
|
|
73
|
+
message: string;
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* Displays a success message with a green checkmark icon.
|
|
77
|
+
*/
|
|
78
|
+
declare function SuccessFeedback({ message }: SuccessFeedbackProps): react_jsx_runtime.JSX.Element;
|
|
79
|
+
|
|
80
|
+
type SubmitButtonProps = {
|
|
81
|
+
label: string;
|
|
82
|
+
loading: boolean;
|
|
83
|
+
loadingLabel: string;
|
|
84
|
+
onPress: () => void;
|
|
85
|
+
disabled?: boolean;
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* Submit button with loading state and optional haptic feedback.
|
|
89
|
+
* Uses @expo/ui Button for native appearance inside Host wrapper.
|
|
90
|
+
*/
|
|
91
|
+
declare function SubmitButton({ label, loading, loadingLabel, onPress, disabled, }: SubmitButtonProps): react_jsx_runtime.JSX.Element;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Available auth screen routes.
|
|
95
|
+
*/
|
|
96
|
+
type AuthRoute = "login" | "signup" | "phone-login" | "magic-link" | "forgot-password" | "reset-password" | "verify-email" | "two-factor";
|
|
97
|
+
type AuthViewProps = {
|
|
98
|
+
/** Which auth screen to render. Defaults to "login". */
|
|
99
|
+
route?: AuthRoute;
|
|
100
|
+
/** Called on successful authentication. */
|
|
101
|
+
onSuccess?: () => void;
|
|
102
|
+
/** Token for deep link screens (reset-password, verify-email, magic-link). */
|
|
103
|
+
token?: string;
|
|
104
|
+
/** Whether biometric auth is available (login screen only). */
|
|
105
|
+
biometricAvailable?: boolean;
|
|
106
|
+
/** Handler for biometric button press (login screen only). */
|
|
107
|
+
onBiometricPress?: () => void;
|
|
108
|
+
/** Fallback content when route doesn't match. */
|
|
109
|
+
fallback?: ReactNode;
|
|
110
|
+
};
|
|
111
|
+
/**
|
|
112
|
+
* AuthView — Route-based renderer for auth screens.
|
|
113
|
+
*
|
|
114
|
+
* Maps a route name to the appropriate auth screen component.
|
|
115
|
+
* For use with expo-router layouts or custom navigation.
|
|
116
|
+
*
|
|
117
|
+
* @example
|
|
118
|
+
* // In app/(auth)/[...slug].tsx:
|
|
119
|
+
* import { AuthView } from "@atzentis/auth-expo";
|
|
120
|
+
*
|
|
121
|
+
* export default function AuthRoute() {
|
|
122
|
+
* const { slug } = useLocalSearchParams();
|
|
123
|
+
* const route = (slug as string[])?.[0] ?? "login";
|
|
124
|
+
* const params = useLocalSearchParams();
|
|
125
|
+
* return (
|
|
126
|
+
* <AuthView
|
|
127
|
+
* route={route}
|
|
128
|
+
* token={params.token as string}
|
|
129
|
+
* onSuccess={() => router.replace("/(app)")}
|
|
130
|
+
* />
|
|
131
|
+
* );
|
|
132
|
+
* }
|
|
133
|
+
*/
|
|
134
|
+
declare function AuthView({ route, onSuccess, token, biometricAvailable, onBiometricPress, fallback, }: AuthViewProps): react_jsx_runtime.JSX.Element;
|
|
135
|
+
|
|
136
|
+
type EmailVerificationScreenProps = {
|
|
137
|
+
onSuccess?: () => void;
|
|
138
|
+
token?: string;
|
|
139
|
+
};
|
|
140
|
+
/** Auto-verifies an email address using the `token` prop from a deep-link URL. */
|
|
141
|
+
declare function EmailVerificationScreen({ onSuccess, token }: EmailVerificationScreenProps): react_jsx_runtime.JSX.Element;
|
|
142
|
+
|
|
143
|
+
type ForgotPasswordScreenProps = {
|
|
144
|
+
onSuccess?: () => void;
|
|
145
|
+
};
|
|
146
|
+
/** Screen for requesting a password-reset email with a 60-second resend cooldown. */
|
|
147
|
+
declare function ForgotPasswordScreen({ onSuccess }: ForgotPasswordScreenProps): react_jsx_runtime.JSX.Element;
|
|
148
|
+
|
|
149
|
+
type LoginScreenProps = {
|
|
150
|
+
biometricAvailable?: boolean;
|
|
151
|
+
onBiometricPress?: () => void;
|
|
152
|
+
onSuccess?: () => void;
|
|
153
|
+
};
|
|
154
|
+
/** Email/password login screen with optional biometric button (iOS only). */
|
|
155
|
+
declare function LoginScreen({ biometricAvailable, onBiometricPress, onSuccess, }: LoginScreenProps): react_jsx_runtime.JSX.Element;
|
|
156
|
+
|
|
157
|
+
type MagicLinkScreenProps = {
|
|
158
|
+
onSuccess?: () => void;
|
|
159
|
+
token?: string;
|
|
160
|
+
};
|
|
161
|
+
/** Magic-link login screen: sends link via email, then auto-verifies when a `token` prop is provided. */
|
|
162
|
+
declare function MagicLinkScreen({ onSuccess, token }: MagicLinkScreenProps): react_jsx_runtime.JSX.Element;
|
|
163
|
+
|
|
164
|
+
type PhoneLoginScreenProps = {
|
|
165
|
+
onSuccess?: () => void;
|
|
166
|
+
};
|
|
167
|
+
/** Two-step phone login screen: collect phone number, then verify the OTP code sent via SMS. */
|
|
168
|
+
declare function PhoneLoginScreen({ onSuccess }: PhoneLoginScreenProps): react_jsx_runtime.JSX.Element;
|
|
169
|
+
|
|
170
|
+
type ResetPasswordScreenProps = {
|
|
171
|
+
onSuccess?: () => void;
|
|
172
|
+
token?: string;
|
|
173
|
+
};
|
|
174
|
+
/** Token-based password reset screen; shows an error state when no token is provided. */
|
|
175
|
+
declare function ResetPasswordScreen({ onSuccess, token }: ResetPasswordScreenProps): react_jsx_runtime.JSX.Element;
|
|
176
|
+
|
|
177
|
+
type SignupScreenProps = {
|
|
178
|
+
onSuccess?: () => void;
|
|
179
|
+
};
|
|
180
|
+
/** Email/password registration screen with name, email, and password fields. */
|
|
181
|
+
declare function SignupScreen({ onSuccess }: SignupScreenProps): react_jsx_runtime.JSX.Element;
|
|
182
|
+
|
|
183
|
+
type TwoFactorScreenProps = {
|
|
184
|
+
onSuccess?: () => void;
|
|
185
|
+
};
|
|
186
|
+
/** TOTP/backup-code verification screen shown after initial credentials are accepted. */
|
|
187
|
+
declare function TwoFactorScreen({ onSuccess }: TwoFactorScreenProps): react_jsx_runtime.JSX.Element;
|
|
188
|
+
|
|
189
|
+
type ChangeEmailScreenProps = {
|
|
190
|
+
onSuccess?: () => void;
|
|
191
|
+
redirectUrl?: string;
|
|
192
|
+
};
|
|
193
|
+
/** Settings screen for changing the account email address; sends a verification link with a resend cooldown. */
|
|
194
|
+
declare function ChangeEmailScreen({ onSuccess, redirectUrl }: ChangeEmailScreenProps): react_jsx_runtime.JSX.Element;
|
|
195
|
+
|
|
196
|
+
type ChangePasswordScreenProps = {
|
|
197
|
+
onSuccess?: () => void;
|
|
198
|
+
};
|
|
199
|
+
/** Settings screen for changing the current user's password (requires current password). */
|
|
200
|
+
declare function ChangePasswordScreen({ onSuccess }: ChangePasswordScreenProps): react_jsx_runtime.JSX.Element;
|
|
201
|
+
|
|
202
|
+
type DeleteAccountScreenProps = {
|
|
203
|
+
confirmationPhrase?: string;
|
|
204
|
+
onSuccess?: () => void;
|
|
205
|
+
};
|
|
206
|
+
/** Destructive settings screen for permanent account deletion; requires typing a confirmation phrase and password. */
|
|
207
|
+
declare function DeleteAccountScreen({ confirmationPhrase, onSuccess, }: DeleteAccountScreenProps): react_jsx_runtime.JSX.Element;
|
|
208
|
+
|
|
209
|
+
type SessionsScreenProps = {
|
|
210
|
+
onSuccess?: () => void;
|
|
211
|
+
};
|
|
212
|
+
/** Settings screen listing all active sessions with individual revoke and revoke-all-others actions. */
|
|
213
|
+
declare function SessionsScreen({ onSuccess }: SessionsScreenProps): react_jsx_runtime.JSX.Element;
|
|
214
|
+
|
|
215
|
+
type TwoFactorSettingsScreenProps = {
|
|
216
|
+
onSuccess?: () => void;
|
|
217
|
+
};
|
|
218
|
+
/** Settings screen for enabling or disabling TOTP two-factor authentication; shows the secret, verify step, and backup codes. */
|
|
219
|
+
declare function TwoFactorSettingsScreen({ onSuccess }: TwoFactorSettingsScreenProps): react_jsx_runtime.JSX.Element;
|
|
220
|
+
|
|
221
|
+
type UpdateAvatarScreenProps = {
|
|
222
|
+
onSuccess?: () => void;
|
|
223
|
+
};
|
|
224
|
+
/** Settings screen for uploading or removing the current user's avatar using the image library. */
|
|
225
|
+
declare function UpdateAvatarScreen({ onSuccess }: UpdateAvatarScreenProps): react_jsx_runtime.JSX.Element;
|
|
226
|
+
|
|
227
|
+
type UpdateNameScreenProps = {
|
|
228
|
+
onSuccess?: () => void;
|
|
229
|
+
};
|
|
230
|
+
/** Settings screen for updating the current user's display name. */
|
|
231
|
+
declare function UpdateNameScreen({ onSuccess }: UpdateNameScreenProps): react_jsx_runtime.JSX.Element;
|
|
232
|
+
|
|
233
|
+
type UpdateUsernameScreenProps = {
|
|
234
|
+
onSuccess?: () => void;
|
|
235
|
+
};
|
|
236
|
+
/** Settings screen for updating the account username with server-side validation. */
|
|
237
|
+
declare function UpdateUsernameScreen({ onSuccess }: UpdateUsernameScreenProps): react_jsx_runtime.JSX.Element;
|
|
238
|
+
|
|
239
|
+
type OrganizationMembersScreenProps = {
|
|
240
|
+
organizationId: string;
|
|
241
|
+
isAdmin?: boolean;
|
|
242
|
+
onSuccess?: () => void;
|
|
243
|
+
};
|
|
244
|
+
/** Screen displaying organization members with role management and removal actions (admin only). */
|
|
245
|
+
declare function OrganizationMembersScreen({ organizationId, isAdmin, onSuccess, }: OrganizationMembersScreenProps): react_jsx_runtime.JSX.Element;
|
|
246
|
+
|
|
247
|
+
type OrganizationSwitcherScreenProps = {
|
|
248
|
+
currentOrgId?: string;
|
|
249
|
+
onSwitch?: (orgId: string) => void;
|
|
250
|
+
};
|
|
251
|
+
/** Screen listing all organizations the user belongs to; selecting one sets it as the active organization. */
|
|
252
|
+
declare function OrganizationSwitcherScreen({ currentOrgId, onSwitch, }: OrganizationSwitcherScreenProps): react_jsx_runtime.JSX.Element;
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* Returns the Better Auth client instance from the nearest `AuthProvider`.
|
|
256
|
+
*
|
|
257
|
+
* @throws {InvalidConfigError} If called outside of an `AuthProvider`.
|
|
258
|
+
* @returns The configured Better Auth client with expo plugin.
|
|
259
|
+
*/
|
|
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
|
+
};
|
|
1051
|
+
|
|
1052
|
+
/**
|
|
1053
|
+
* Returns the resolved auth localization strings and the `localizeErrors` flag
|
|
1054
|
+
* from the nearest `AuthProvider`.
|
|
1055
|
+
*
|
|
1056
|
+
* @returns `{ localization, localizeErrors }` — use `localization.SIGN_IN` etc. inside SDK screens.
|
|
1057
|
+
*/
|
|
1058
|
+
declare function useAuthLocalization(): {
|
|
1059
|
+
localization: _atzentis_auth_locales.AuthLocalization;
|
|
1060
|
+
localizeErrors: boolean;
|
|
1061
|
+
};
|
|
1062
|
+
|
|
1063
|
+
declare function useAuthRedirect(): {
|
|
1064
|
+
redirectToSignIn: (returnUrl?: string) => void;
|
|
1065
|
+
redirectToSignUp: (returnUrl?: string) => void;
|
|
1066
|
+
};
|
|
1067
|
+
|
|
1068
|
+
type BiometricAvailability = {
|
|
1069
|
+
hasHardware: boolean;
|
|
1070
|
+
isEnrolled: boolean;
|
|
1071
|
+
supportedTypes: number[];
|
|
1072
|
+
};
|
|
1073
|
+
/**
|
|
1074
|
+
* Hook for biometric authentication (Face ID / Touch ID / fingerprint).
|
|
1075
|
+
*
|
|
1076
|
+
* @returns An object with:
|
|
1077
|
+
* - `checkAvailability` — async function that resolves with `{ hasHardware, isEnrolled, supportedTypes }`.
|
|
1078
|
+
* - `authenticate` — TanStack mutation that accepts a `promptMessage` string and triggers the system biometric prompt.
|
|
1079
|
+
*
|
|
1080
|
+
* @example
|
|
1081
|
+
* ```tsx
|
|
1082
|
+
* const { checkAvailability, authenticate } = useBiometric();
|
|
1083
|
+
* const available = await checkAvailability();
|
|
1084
|
+
* if (available.isEnrolled) {
|
|
1085
|
+
* authenticate.mutate("Authenticate to sign in");
|
|
1086
|
+
* }
|
|
1087
|
+
* ```
|
|
1088
|
+
*/
|
|
1089
|
+
declare function useBiometric(): {
|
|
1090
|
+
checkAvailability: () => Promise<BiometricAvailability>;
|
|
1091
|
+
authenticate: _tanstack_react_query.UseMutationResult<{
|
|
1092
|
+
success: true;
|
|
1093
|
+
}, Error, string, unknown>;
|
|
1094
|
+
};
|
|
1095
|
+
|
|
1096
|
+
type LoginInput = {
|
|
1097
|
+
email: string;
|
|
1098
|
+
password: string;
|
|
1099
|
+
};
|
|
1100
|
+
/**
|
|
1101
|
+
* Mutation hook for email/password login.
|
|
1102
|
+
*
|
|
1103
|
+
* On success, writes the returned user and session into the TanStack Query cache
|
|
1104
|
+
* via the `authKeys` factory so that `useUser` and `useSession` update immediately.
|
|
1105
|
+
*
|
|
1106
|
+
* @returns A TanStack `UseMutationResult` — call `.mutate({ email, password })` to sign in.
|
|
1107
|
+
*/
|
|
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>;
|
|
1132
|
+
|
|
1133
|
+
/**
|
|
1134
|
+
* Mutation hook for signing out the current user.
|
|
1135
|
+
*
|
|
1136
|
+
* On success, sets user and session cache to `null` and invalidates all
|
|
1137
|
+
* session-related queries so the UI reflects the signed-out state immediately.
|
|
1138
|
+
*
|
|
1139
|
+
* @returns A TanStack `UseMutationResult` — call `.mutate()` with no arguments to sign out.
|
|
1140
|
+
*/
|
|
1141
|
+
declare function useLogout(): _tanstack_react_query.UseMutationResult<{
|
|
1142
|
+
success: boolean;
|
|
1143
|
+
}, Error, void, unknown>;
|
|
1144
|
+
|
|
1145
|
+
type RequestPasswordResetInput = {
|
|
1146
|
+
email: string;
|
|
1147
|
+
redirectTo?: string;
|
|
1148
|
+
};
|
|
1149
|
+
/**
|
|
1150
|
+
* Mutation hook for requesting a password reset email.
|
|
1151
|
+
*/
|
|
1152
|
+
declare function useRequestPasswordReset(): _tanstack_react_query.UseMutationResult<boolean, Error, RequestPasswordResetInput, unknown>;
|
|
1153
|
+
|
|
1154
|
+
type ResetPasswordInput = {
|
|
1155
|
+
newPassword: string;
|
|
1156
|
+
token: string;
|
|
1157
|
+
};
|
|
1158
|
+
/**
|
|
1159
|
+
* Mutation hook for resetting a password using a token from the reset email.
|
|
1160
|
+
*/
|
|
1161
|
+
declare function useResetPassword(): _tanstack_react_query.UseMutationResult<boolean, Error, ResetPasswordInput, unknown>;
|
|
1162
|
+
|
|
1163
|
+
type SignupInput = {
|
|
1164
|
+
email: string;
|
|
1165
|
+
name: string;
|
|
1166
|
+
password: string;
|
|
1167
|
+
};
|
|
1168
|
+
/**
|
|
1169
|
+
* Mutation hook for email/password signup.
|
|
1170
|
+
*
|
|
1171
|
+
* On success, writes the returned user and session into the TanStack Query cache
|
|
1172
|
+
* via the `authKeys` factory so that `useUser` and `useSession` update immediately.
|
|
1173
|
+
*
|
|
1174
|
+
* @returns A TanStack `UseMutationResult` — call `.mutate({ email, name, password })` to register.
|
|
1175
|
+
*/
|
|
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>;
|
|
1219
|
+
|
|
1220
|
+
/**
|
|
1221
|
+
* Query hook for the current session.
|
|
3
1222
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
|
|
9
|
-
|
|
1223
|
+
* Fetches via `client.getSession()` and extracts the session object.
|
|
1224
|
+
* Data is cached for 5 minutes (`staleTime`). Returns `null` when not authenticated.
|
|
1225
|
+
*
|
|
1226
|
+
* @returns A TanStack `UseQueryResult<Session | null>`.
|
|
1227
|
+
*/
|
|
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>;
|
|
1238
|
+
|
|
1239
|
+
/**
|
|
1240
|
+
* Query hook for the current authenticated user.
|
|
1241
|
+
*
|
|
1242
|
+
* Fetches via `client.getSession()` and extracts the user object.
|
|
1243
|
+
* Data is cached for 5 minutes (`staleTime`). Returns `null` when not authenticated.
|
|
1244
|
+
*
|
|
1245
|
+
* @returns A TanStack `UseQueryResult<User | null>`.
|
|
10
1246
|
*/
|
|
11
|
-
declare
|
|
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>;
|
|
1256
|
+
|
|
1257
|
+
type AuthProviderProps = {
|
|
1258
|
+
baseURL: string;
|
|
1259
|
+
children: react__default.ReactNode;
|
|
1260
|
+
locales?: Record<string, AuthLocalization>;
|
|
1261
|
+
localization?: Partial<AuthLocalization>;
|
|
1262
|
+
queryClient?: QueryClient;
|
|
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;
|
|
1267
|
+
|
|
1268
|
+
/**
|
|
1269
|
+
* @atzentis/auth-expo - React Native/Expo integration for Atzentis Auth SDK
|
|
1270
|
+
*/
|
|
1271
|
+
|
|
1272
|
+
declare const VERSION = "0.1.0";
|
|
12
1273
|
|
|
13
|
-
export { VERSION };
|
|
1274
|
+
export { AuthContainer, AuthGate, type AuthGateProps, AuthProvider, type AuthRoute, AuthView, type AuthViewProps, ChangeEmailScreen, type ChangeEmailScreenProps, ChangePasswordScreen, type ChangePasswordScreenProps, DeleteAccountScreen, type DeleteAccountScreenProps, EmailVerificationScreen, type EmailVerificationScreenProps, ErrorFeedback, ForgotPasswordScreen, type ForgotPasswordScreenProps, FormInput, FormPasswordInput, LoginScreen, type LoginScreenProps, MagicLinkScreen, type MagicLinkScreenProps, OAuthButton, type OAuthButtonProps, OrganizationMembersScreen, type OrganizationMembersScreenProps, OrganizationSwitcherScreen, type OrganizationSwitcherScreenProps, PhoneLoginScreen, type PhoneLoginScreenProps, ProtectedScreen, type ProtectedScreenProps, ResetPasswordScreen, type ResetPasswordScreenProps, SessionsScreen, type SessionsScreenProps, SignupScreen, type SignupScreenProps, SubmitButton, SuccessFeedback, TwoFactorScreen, type TwoFactorScreenProps, TwoFactorSettingsScreen, type TwoFactorSettingsScreenProps, UpdateAvatarScreen, type UpdateAvatarScreenProps, UpdateNameScreen, type UpdateNameScreenProps, UpdateUsernameScreen, type UpdateUsernameScreenProps, VERSION, useAuthClient, useAuthLocalization, useAuthRedirect, useBiometric, useLogin, useLogout, useRequestPasswordReset, useResetPassword, useSession, useSignup, useUser };
|