@atzentis/auth-react 0.0.12 → 0.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +782 -3
- package/dist/index.js +2076 -8
- package/dist/index.js.map +1 -1
- package/package.json +18 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,408 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as react from 'react';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
3
4
|
import * as _atzentis_auth_sdk from '@atzentis/auth-sdk';
|
|
4
|
-
import { AuthClient, User, Session, AuthError, LoginAlert, ITokenStorage, LoginCredentials, SignupData } from '@atzentis/auth-sdk';
|
|
5
|
+
import { AuthClient, User, Session, AuthError, LoginAlert, ITokenStorage, ApiKey, CreateApiKeyRequest, UpdateApiKeyRequest, LoginCredentials, UsernameLoginCredentials, SignupData, GetOAuthUrlRequest, VerifyOAuthCodeRequest, SendMagicLinkRequest, VerifyMagicLinkRequest, Device, LoginEvent, ListLoginEventsRequest, Organization, CreateOrganizationRequest, UpdateOrganizationRequest, ListMembersRequest, UpdateMemberRequest, InviteMemberRequest, ListInvitationsRequest, AcceptInvitationRequest, DeclineInvitationRequest, DeviceSession, RevokeAllSessionsOptions, UserUpdate, ConnectOAuthRequest, OAuthProvider } from '@atzentis/auth-sdk';
|
|
6
|
+
import { z } from 'zod';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Centralized localization for all @atzentis/auth-react components.
|
|
10
|
+
*
|
|
11
|
+
* This const object contains all default English strings.
|
|
12
|
+
* The `AuthLocalization` type is derived as `Partial<typeof authLocalization>`.
|
|
13
|
+
*
|
|
14
|
+
* Pass a partial override to AuthProvider:
|
|
15
|
+
* ```tsx
|
|
16
|
+
* const de: AuthLocalization = { SIGN_IN: "Anmelden", ... };
|
|
17
|
+
* <AuthProvider localization={de}>
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
declare const authLocalization: {
|
|
21
|
+
INVALID_CREDENTIALS: string;
|
|
22
|
+
EMAIL_NOT_VERIFIED: string;
|
|
23
|
+
TWO_FACTOR_REQUIRED: string;
|
|
24
|
+
INVALID_PHONE_NUMBER: string;
|
|
25
|
+
OTP_EXPIRED: string;
|
|
26
|
+
OTP_INVALID: string;
|
|
27
|
+
OTP_MAX_ATTEMPTS: string;
|
|
28
|
+
PHONE_NUMBER_IN_USE: string;
|
|
29
|
+
FRAUD_DETECTED: string;
|
|
30
|
+
USERNAME_TAKEN: string;
|
|
31
|
+
USERNAME_INVALID: string;
|
|
32
|
+
USERNAME_RESERVED: string;
|
|
33
|
+
DEVICE_NOT_FOUND: string;
|
|
34
|
+
LOGIN_EVENT_NOT_FOUND: string;
|
|
35
|
+
REAUTH_REQUIRED: string;
|
|
36
|
+
MAX_SESSIONS_EXCEEDED: string;
|
|
37
|
+
CAPTCHA_REQUIRED: string;
|
|
38
|
+
CAPTCHA_INVALID: string;
|
|
39
|
+
PASSWORD_BREACHED: string;
|
|
40
|
+
SESSION_EXPIRED: string;
|
|
41
|
+
TOKEN_EXPIRED: string;
|
|
42
|
+
INVALID_TOKEN: string;
|
|
43
|
+
UNAUTHORIZED_ROLE: string;
|
|
44
|
+
ORGANIZATION_NOT_FOUND: string;
|
|
45
|
+
PERMISSION_DENIED: string;
|
|
46
|
+
RATE_LIMITED: string;
|
|
47
|
+
NETWORK_ERROR: string;
|
|
48
|
+
TIMEOUT: string;
|
|
49
|
+
USER_NOT_FOUND: string;
|
|
50
|
+
USER_ALREADY_EXISTS: string;
|
|
51
|
+
INVALID_EMAIL: string;
|
|
52
|
+
WEAK_PASSWORD: string;
|
|
53
|
+
ORG_LIMIT_EXCEEDED: string;
|
|
54
|
+
MEMBER_LIMIT_EXCEEDED: string;
|
|
55
|
+
KEY_NOT_FOUND: string;
|
|
56
|
+
KEY_REVOKED: string;
|
|
57
|
+
KEY_EXPIRED: string;
|
|
58
|
+
/** @default "Continue" */
|
|
59
|
+
CONTINUE: string;
|
|
60
|
+
/** @default "Cancel" */
|
|
61
|
+
CANCEL: string;
|
|
62
|
+
/** @default "Save" */
|
|
63
|
+
SAVE: string;
|
|
64
|
+
/** @default "Delete" */
|
|
65
|
+
DELETE: string;
|
|
66
|
+
/** @default "Update" */
|
|
67
|
+
UPDATE: string;
|
|
68
|
+
/** @default "Remove" */
|
|
69
|
+
REMOVE: string;
|
|
70
|
+
/** @default "Done" */
|
|
71
|
+
DONE: string;
|
|
72
|
+
/** @default "Go back" */
|
|
73
|
+
GO_BACK: string;
|
|
74
|
+
/** @default "Loading..." */
|
|
75
|
+
LOADING: string;
|
|
76
|
+
/** @default "Load more" */
|
|
77
|
+
LOAD_MORE: string;
|
|
78
|
+
/** @default "Unknown" */
|
|
79
|
+
UNKNOWN: string;
|
|
80
|
+
/** @default "Request failed" */
|
|
81
|
+
REQUEST_FAILED: string;
|
|
82
|
+
/** @default "Updated successfully" */
|
|
83
|
+
UPDATED_SUCCESSFULLY: string;
|
|
84
|
+
/** @default "Sign in" */
|
|
85
|
+
SIGN_IN: string;
|
|
86
|
+
/** @default "Sign in" */
|
|
87
|
+
SIGN_IN_ACTION: string;
|
|
88
|
+
/** @default "Enter your email below to sign in" */
|
|
89
|
+
SIGN_IN_DESCRIPTION: string;
|
|
90
|
+
/** @default "Enter your username or email to sign in" */
|
|
91
|
+
SIGN_IN_USERNAME_DESCRIPTION: string;
|
|
92
|
+
/** @default "Username or email" */
|
|
93
|
+
SIGN_IN_USERNAME_PLACEHOLDER: string;
|
|
94
|
+
/** @default "Signing in..." */
|
|
95
|
+
SIGNING_IN: string;
|
|
96
|
+
/** @default "m@example.com" */
|
|
97
|
+
EMAIL_PLACEHOLDER: string;
|
|
98
|
+
/** @default "Password" */
|
|
99
|
+
PASSWORD_PLACEHOLDER: string;
|
|
100
|
+
/** @default "Forgot your password?" */
|
|
101
|
+
FORGOT_PASSWORD_LINK: string;
|
|
102
|
+
/** @default "Use phone instead" */
|
|
103
|
+
USE_PHONE_INSTEAD: string;
|
|
104
|
+
/** @default "Use email instead" */
|
|
105
|
+
USE_EMAIL_INSTEAD: string;
|
|
106
|
+
/** @default "Or continue with" */
|
|
107
|
+
OR_CONTINUE_WITH: string;
|
|
108
|
+
/** @default "Sign in with" */
|
|
109
|
+
SIGN_IN_WITH: string;
|
|
110
|
+
/** @default "Don't have an account?" */
|
|
111
|
+
DONT_HAVE_AN_ACCOUNT: string;
|
|
112
|
+
/** @default "Remember me" */
|
|
113
|
+
REMEMBER_ME: string;
|
|
114
|
+
/** @default "Sign up" */
|
|
115
|
+
SIGN_UP: string;
|
|
116
|
+
/** @default "Create account" */
|
|
117
|
+
SIGN_UP_ACTION: string;
|
|
118
|
+
/** @default "Enter your information to create an account" */
|
|
119
|
+
SIGN_UP_DESCRIPTION: string;
|
|
120
|
+
/** @default "Check your email for the verification link." */
|
|
121
|
+
SIGN_UP_EMAIL: string;
|
|
122
|
+
/** @default "Name" */
|
|
123
|
+
NAME_PLACEHOLDER: string;
|
|
124
|
+
/** @default "Please enter your full name." */
|
|
125
|
+
NAME_DESCRIPTION: string;
|
|
126
|
+
/** @default "Username" */
|
|
127
|
+
USERNAME_PLACEHOLDER: string;
|
|
128
|
+
/** @default "Username" */
|
|
129
|
+
USERNAME: string;
|
|
130
|
+
/** @default "Confirm password" */
|
|
131
|
+
CONFIRM_PASSWORD_PLACEHOLDER: string;
|
|
132
|
+
/** @default "Already have an account?" */
|
|
133
|
+
ALREADY_HAVE_AN_ACCOUNT: string;
|
|
134
|
+
/** @default "I accept the terms and conditions" */
|
|
135
|
+
ACCEPT_TERMS: string;
|
|
136
|
+
/** @default "You must accept the terms" */
|
|
137
|
+
ACCEPT_TERMS_ERROR: string;
|
|
138
|
+
/** @default "By continuing, you agree to the" */
|
|
139
|
+
BY_CONTINUING_YOU_AGREE: string;
|
|
140
|
+
/** @default "Terms of Service" */
|
|
141
|
+
TERMS_OF_SERVICE: string;
|
|
142
|
+
/** @default "Privacy Policy" */
|
|
143
|
+
PRIVACY_POLICY: string;
|
|
144
|
+
/** @default "Phone number" */
|
|
145
|
+
PHONE_NUMBER_PLACEHOLDER: string;
|
|
146
|
+
/** @default "Country code" */
|
|
147
|
+
COUNTRY_CODE: string;
|
|
148
|
+
/** @default "Send code" */
|
|
149
|
+
SEND_VERIFICATION_CODE: string;
|
|
150
|
+
/** @default "Sending code..." */
|
|
151
|
+
SENDING_VERIFICATION_CODE: string;
|
|
152
|
+
/** @default "One-Time Password" */
|
|
153
|
+
ONE_TIME_PASSWORD: string;
|
|
154
|
+
/** @default "Verification code" */
|
|
155
|
+
VERIFICATION_CODE_LABEL: string;
|
|
156
|
+
/** @default "Verify" */
|
|
157
|
+
VERIFY: string;
|
|
158
|
+
/** @default "Verifying..." */
|
|
159
|
+
VERIFYING: string;
|
|
160
|
+
/** @default "Code expires in" */
|
|
161
|
+
CODE_EXPIRES_IN: string;
|
|
162
|
+
/** @default "Resend code" */
|
|
163
|
+
RESEND_CODE: string;
|
|
164
|
+
/** @default "Sign in with password" */
|
|
165
|
+
USE_PASSWORD_INSTEAD: string;
|
|
166
|
+
/** @default "Continue with" */
|
|
167
|
+
CONTINUE_WITH: string;
|
|
168
|
+
/** @default "Redirecting..." */
|
|
169
|
+
REDIRECTING: string;
|
|
170
|
+
/** @default "Magic Link" */
|
|
171
|
+
MAGIC_LINK: string;
|
|
172
|
+
/** @default "Send magic link" */
|
|
173
|
+
MAGIC_LINK_ACTION: string;
|
|
174
|
+
/** @default "Enter your email to receive a magic link" */
|
|
175
|
+
MAGIC_LINK_DESCRIPTION: string;
|
|
176
|
+
/** @default "We sent a magic link to" */
|
|
177
|
+
MAGIC_LINK_EMAIL: string;
|
|
178
|
+
/** @default "Check your inbox and click the link to sign in." */
|
|
179
|
+
MAGIC_LINK_HINT: string;
|
|
180
|
+
/** @default "Sending..." */
|
|
181
|
+
SENDING: string;
|
|
182
|
+
/** @default "Resend" */
|
|
183
|
+
RESEND: string;
|
|
184
|
+
/** @default "Resending..." */
|
|
185
|
+
RESENDING: string;
|
|
186
|
+
/** @default "Password" */
|
|
187
|
+
PASSWORD: string;
|
|
188
|
+
/** @default "New Password" */
|
|
189
|
+
NEW_PASSWORD: string;
|
|
190
|
+
/** @default "Current Password" */
|
|
191
|
+
CURRENT_PASSWORD: string;
|
|
192
|
+
/** @default "Change Password" */
|
|
193
|
+
CHANGE_PASSWORD: string;
|
|
194
|
+
/** @default "Enter your current and new password" */
|
|
195
|
+
CHANGE_PASSWORD_DESCRIPTION: string;
|
|
196
|
+
/** @default "Password has been changed" */
|
|
197
|
+
CHANGE_PASSWORD_SUCCESS: string;
|
|
198
|
+
/** @default "Forgot Password" */
|
|
199
|
+
FORGOT_PASSWORD: string;
|
|
200
|
+
/** @default "Send reset link" */
|
|
201
|
+
FORGOT_PASSWORD_ACTION: string;
|
|
202
|
+
/** @default "Enter your email to reset your password" */
|
|
203
|
+
FORGOT_PASSWORD_DESCRIPTION: string;
|
|
204
|
+
/** @default "Check your email for the reset link" */
|
|
205
|
+
FORGOT_PASSWORD_EMAIL: string;
|
|
206
|
+
/** @default "Reset Password" */
|
|
207
|
+
RESET_PASSWORD: string;
|
|
208
|
+
/** @default "Save new password" */
|
|
209
|
+
RESET_PASSWORD_ACTION: string;
|
|
210
|
+
/** @default "Password reset successfully" */
|
|
211
|
+
RESET_PASSWORD_SUCCESS: string;
|
|
212
|
+
/** @default "Set Password" */
|
|
213
|
+
SET_PASSWORD: string;
|
|
214
|
+
/** @default "Click the button to receive an email to set your password" */
|
|
215
|
+
SET_PASSWORD_DESCRIPTION: string;
|
|
216
|
+
/** @default "Current Session" */
|
|
217
|
+
CURRENT_SESSION: string;
|
|
218
|
+
/** @default "Current device" */
|
|
219
|
+
CURRENT_DEVICE: string;
|
|
220
|
+
/** @default "Sessions" */
|
|
221
|
+
SESSIONS: string;
|
|
222
|
+
/** @default "Manage your active sessions" */
|
|
223
|
+
SESSIONS_DESCRIPTION: string;
|
|
224
|
+
/** @default "Trust" */
|
|
225
|
+
TRUST_DEVICE: string;
|
|
226
|
+
/** @default "Untrust" */
|
|
227
|
+
UNTRUST_DEVICE: string;
|
|
228
|
+
/** @default "Loading devices..." */
|
|
229
|
+
LOADING_DEVICES: string;
|
|
230
|
+
/** @default "No devices found" */
|
|
231
|
+
NO_DEVICES: string;
|
|
232
|
+
/** @default "Last used:" */
|
|
233
|
+
LAST_USED: string;
|
|
234
|
+
/** @default "IP:" */
|
|
235
|
+
IP_LABEL: string;
|
|
236
|
+
/** @default "Security" */
|
|
237
|
+
SECURITY: string;
|
|
238
|
+
/** @default "Session not fresh. Please sign in again." */
|
|
239
|
+
SESSION_NOT_FRESH: string;
|
|
240
|
+
/** @default "Login Activity" */
|
|
241
|
+
LOGIN_ACTIVITY: string;
|
|
242
|
+
/** @default "Recent login attempts" */
|
|
243
|
+
LOGIN_ACTIVITY_DESCRIPTION: string;
|
|
244
|
+
/** @default "Low" */
|
|
245
|
+
RISK_LOW: string;
|
|
246
|
+
/** @default "Medium" */
|
|
247
|
+
RISK_MEDIUM: string;
|
|
248
|
+
/** @default "High" */
|
|
249
|
+
RISK_HIGH: string;
|
|
250
|
+
/** @default "This was me" */
|
|
251
|
+
MARK_RECOGNIZED: string;
|
|
252
|
+
/** @default "Not me" */
|
|
253
|
+
REPORT_SUSPICIOUS: string;
|
|
254
|
+
/** @default "Loading activity..." */
|
|
255
|
+
LOADING_ACTIVITY: string;
|
|
256
|
+
/** @default "No login activity found" */
|
|
257
|
+
NO_ACTIVITY: string;
|
|
258
|
+
/** @default "Accounts" */
|
|
259
|
+
ACCOUNTS: string;
|
|
260
|
+
/** @default "Manage signed in accounts" */
|
|
261
|
+
ACCOUNTS_DESCRIPTION: string;
|
|
262
|
+
/** @default "Add account" */
|
|
263
|
+
ADD_ACCOUNT: string;
|
|
264
|
+
/** @default "Switch Account" */
|
|
265
|
+
SWITCH_ACCOUNT: string;
|
|
266
|
+
/** @default "Select account" */
|
|
267
|
+
SELECT_ACCOUNT: string;
|
|
268
|
+
/** @default "Personal Account" */
|
|
269
|
+
PERSONAL_ACCOUNT: string;
|
|
270
|
+
/** @default "Sign out" */
|
|
271
|
+
SIGN_OUT: string;
|
|
272
|
+
/** @default "Organization" */
|
|
273
|
+
ORGANIZATION: string;
|
|
274
|
+
/** @default "Organizations" */
|
|
275
|
+
ORGANIZATIONS: string;
|
|
276
|
+
/** @default "Manage your organizations" */
|
|
277
|
+
ORGANIZATIONS_DESCRIPTION: string;
|
|
278
|
+
/** @default "Select organization" */
|
|
279
|
+
SELECT_ORGANIZATION: string;
|
|
280
|
+
/** @default "Create organization" */
|
|
281
|
+
CREATE_ORGANIZATION: string;
|
|
282
|
+
/** @default "Name" */
|
|
283
|
+
ORGANIZATION_NAME: string;
|
|
284
|
+
/** @default "Acme Inc." */
|
|
285
|
+
ORGANIZATION_NAME_PLACEHOLDER: string;
|
|
286
|
+
/** @default "Leave Organization" */
|
|
287
|
+
LEAVE_ORGANIZATION: string;
|
|
288
|
+
/** @default "Delete Organization" */
|
|
289
|
+
DELETE_ORGANIZATION: string;
|
|
290
|
+
/** @default "Members" */
|
|
291
|
+
MEMBERS: string;
|
|
292
|
+
/** @default "Invite Member" */
|
|
293
|
+
INVITE_MEMBER: string;
|
|
294
|
+
/** @default "Remove Member" */
|
|
295
|
+
REMOVE_MEMBER: string;
|
|
296
|
+
/** @default "Role" */
|
|
297
|
+
ROLE: string;
|
|
298
|
+
/** @default "Admin" */
|
|
299
|
+
ADMIN: string;
|
|
300
|
+
/** @default "Member" */
|
|
301
|
+
MEMBER: string;
|
|
302
|
+
/** @default "Owner" */
|
|
303
|
+
OWNER: string;
|
|
304
|
+
/** @default "Settings" */
|
|
305
|
+
SETTINGS: string;
|
|
306
|
+
/** @default "Account" */
|
|
307
|
+
ACCOUNT: string;
|
|
308
|
+
/** @default "Avatar" */
|
|
309
|
+
AVATAR: string;
|
|
310
|
+
/** @default "Click avatar to upload a custom one" */
|
|
311
|
+
AVATAR_DESCRIPTION: string;
|
|
312
|
+
/** @default "Delete Avatar" */
|
|
313
|
+
DELETE_AVATAR: string;
|
|
314
|
+
/** @default "Upload Avatar" */
|
|
315
|
+
UPLOAD_AVATAR: string;
|
|
316
|
+
/** @default "Email" */
|
|
317
|
+
EMAIL: string;
|
|
318
|
+
/** @default "Name" */
|
|
319
|
+
NAME: string;
|
|
320
|
+
/** @default "Two-Factor" */
|
|
321
|
+
TWO_FACTOR: string;
|
|
322
|
+
/** @default "Two-Factor Authentication" */
|
|
323
|
+
TWO_FACTOR_PROMPT: string;
|
|
324
|
+
/** @default "Enter your one-time password" */
|
|
325
|
+
TWO_FACTOR_DESCRIPTION: string;
|
|
326
|
+
/** @default "Verify code" */
|
|
327
|
+
TWO_FACTOR_ACTION: string;
|
|
328
|
+
/** @default "Two-factor authentication has been enabled" */
|
|
329
|
+
TWO_FACTOR_ENABLED: string;
|
|
330
|
+
/** @default "Two-factor authentication has been disabled" */
|
|
331
|
+
TWO_FACTOR_DISABLED: string;
|
|
332
|
+
/** @default "Enable Two-Factor" */
|
|
333
|
+
ENABLE_TWO_FACTOR: string;
|
|
334
|
+
/** @default "Disable Two-Factor" */
|
|
335
|
+
DISABLE_TWO_FACTOR: string;
|
|
336
|
+
/** @default "Backup Codes" */
|
|
337
|
+
BACKUP_CODES: string;
|
|
338
|
+
/** @default "Save these codes in a secure place" */
|
|
339
|
+
BACKUP_CODES_DESCRIPTION: string;
|
|
340
|
+
/** @default "Passwords do not match" */
|
|
341
|
+
PASSWORDS_DO_NOT_MATCH: string;
|
|
342
|
+
/** @default "Password is required" */
|
|
343
|
+
PASSWORD_REQUIRED: string;
|
|
344
|
+
/** @default "Email address is required" */
|
|
345
|
+
EMAIL_REQUIRED: string;
|
|
346
|
+
/** @default "is required" */
|
|
347
|
+
IS_REQUIRED: string;
|
|
348
|
+
/** @default "is invalid" */
|
|
349
|
+
IS_INVALID: string;
|
|
350
|
+
};
|
|
351
|
+
type AuthLocalization = Partial<typeof authLocalization>;
|
|
352
|
+
|
|
353
|
+
declare const AUTH_ERROR_CODES: {
|
|
354
|
+
INVALID_CREDENTIALS: string;
|
|
355
|
+
EMAIL_NOT_VERIFIED: string;
|
|
356
|
+
TWO_FACTOR_REQUIRED: string;
|
|
357
|
+
INVALID_PHONE_NUMBER: string;
|
|
358
|
+
OTP_EXPIRED: string;
|
|
359
|
+
OTP_INVALID: string;
|
|
360
|
+
OTP_MAX_ATTEMPTS: string;
|
|
361
|
+
PHONE_NUMBER_IN_USE: string;
|
|
362
|
+
FRAUD_DETECTED: string;
|
|
363
|
+
USERNAME_TAKEN: string;
|
|
364
|
+
USERNAME_INVALID: string;
|
|
365
|
+
USERNAME_RESERVED: string;
|
|
366
|
+
DEVICE_NOT_FOUND: string;
|
|
367
|
+
LOGIN_EVENT_NOT_FOUND: string;
|
|
368
|
+
REAUTH_REQUIRED: string;
|
|
369
|
+
MAX_SESSIONS_EXCEEDED: string;
|
|
370
|
+
CAPTCHA_REQUIRED: string;
|
|
371
|
+
CAPTCHA_INVALID: string;
|
|
372
|
+
PASSWORD_BREACHED: string;
|
|
373
|
+
SESSION_EXPIRED: string;
|
|
374
|
+
TOKEN_EXPIRED: string;
|
|
375
|
+
INVALID_TOKEN: string;
|
|
376
|
+
UNAUTHORIZED_ROLE: string;
|
|
377
|
+
ORGANIZATION_NOT_FOUND: string;
|
|
378
|
+
PERMISSION_DENIED: string;
|
|
379
|
+
RATE_LIMITED: string;
|
|
380
|
+
NETWORK_ERROR: string;
|
|
381
|
+
TIMEOUT: string;
|
|
382
|
+
USER_NOT_FOUND: string;
|
|
383
|
+
USER_ALREADY_EXISTS: string;
|
|
384
|
+
INVALID_EMAIL: string;
|
|
385
|
+
WEAK_PASSWORD: string;
|
|
386
|
+
ORG_LIMIT_EXCEEDED: string;
|
|
387
|
+
MEMBER_LIMIT_EXCEEDED: string;
|
|
388
|
+
KEY_NOT_FOUND: string;
|
|
389
|
+
KEY_REVOKED: string;
|
|
390
|
+
KEY_EXPIRED: string;
|
|
391
|
+
};
|
|
392
|
+
|
|
393
|
+
/**
|
|
394
|
+
* Gets a localized error message from an error object.
|
|
395
|
+
*
|
|
396
|
+
* When `localizeErrors` is true, looks up the error code directly
|
|
397
|
+
* in the localization dictionary (error codes are localization keys).
|
|
398
|
+
*
|
|
399
|
+
* Fallback chain:
|
|
400
|
+
* 1. localization[error.code] (if AuthError and localizeErrors)
|
|
401
|
+
* 2. error.message
|
|
402
|
+
* 3. localization.REQUEST_FAILED
|
|
403
|
+
* 4. "Request failed"
|
|
404
|
+
*/
|
|
405
|
+
declare function getLocalizedError(error: unknown, localization: AuthLocalization, localizeErrors: boolean): string;
|
|
5
406
|
|
|
6
407
|
interface AuthProviderProps {
|
|
7
408
|
apiKey?: string;
|
|
@@ -17,6 +418,8 @@ interface AuthProviderProps {
|
|
|
17
418
|
initialToken?: string;
|
|
18
419
|
initialUser?: User;
|
|
19
420
|
storage?: ITokenStorage;
|
|
421
|
+
localization?: AuthLocalization;
|
|
422
|
+
localizeErrors?: boolean;
|
|
20
423
|
}
|
|
21
424
|
interface AuthContextValue {
|
|
22
425
|
client: AuthClient;
|
|
@@ -32,7 +435,26 @@ interface AuthContextValue {
|
|
|
32
435
|
}
|
|
33
436
|
|
|
34
437
|
declare const AuthContext: react.Context<AuthContextValue | null>;
|
|
35
|
-
|
|
438
|
+
interface LocalizationContextValue {
|
|
439
|
+
overrides: AuthLocalization | null;
|
|
440
|
+
localizeErrors: boolean;
|
|
441
|
+
}
|
|
442
|
+
declare const LocalizationContext: react.Context<LocalizationContextValue>;
|
|
443
|
+
declare function AuthProvider({ apiKey, baseUrl, autoRefreshToken, refreshThreshold, timeout, collectDeviceSignals, onSessionExpired, onTokenRefreshed, onNewDeviceAlert, children, initialUser, storage, localization, localizeErrors, }: AuthProviderProps): react_jsx_runtime.JSX.Element;
|
|
444
|
+
|
|
445
|
+
declare function useApiKeys(): {
|
|
446
|
+
apiKeys: ApiKey[];
|
|
447
|
+
isLoading: boolean;
|
|
448
|
+
error: AuthError | null;
|
|
449
|
+
refresh: () => Promise<void>;
|
|
450
|
+
create: (data: CreateApiKeyRequest) => Promise<_atzentis_auth_sdk.CreateApiKeyResponse>;
|
|
451
|
+
get: (keyId: string) => Promise<ApiKey>;
|
|
452
|
+
update: (keyId: string, data: UpdateApiKeyRequest) => Promise<ApiKey>;
|
|
453
|
+
rotate: (keyId: string) => Promise<_atzentis_auth_sdk.RotateApiKeyResponse>;
|
|
454
|
+
revoke: (keyId: string) => Promise<void>;
|
|
455
|
+
validate: (keyString: string) => Promise<_atzentis_auth_sdk.ValidateApiKeyResponse>;
|
|
456
|
+
getUsage: (keyId: string) => Promise<_atzentis_auth_sdk.ApiKeyUsage>;
|
|
457
|
+
};
|
|
36
458
|
|
|
37
459
|
declare function useAuth(): {
|
|
38
460
|
user: _atzentis_auth_sdk.User | null;
|
|
@@ -40,12 +462,92 @@ declare function useAuth(): {
|
|
|
40
462
|
isLoading: boolean;
|
|
41
463
|
error: _atzentis_auth_sdk.AuthError | null;
|
|
42
464
|
login: (credentials: LoginCredentials) => Promise<_atzentis_auth_sdk.LoginResponse>;
|
|
465
|
+
loginWithUsername: (credentials: UsernameLoginCredentials) => Promise<_atzentis_auth_sdk.LoginResponse>;
|
|
43
466
|
signup: (data: SignupData) => Promise<_atzentis_auth_sdk.SignupResponse>;
|
|
467
|
+
logout: () => Promise<void>;
|
|
468
|
+
logoutAllDevices: () => Promise<void>;
|
|
469
|
+
getOAuthUrl: (config: GetOAuthUrlRequest) => string;
|
|
470
|
+
verifyOAuthCode: (request: VerifyOAuthCodeRequest) => Promise<_atzentis_auth_sdk.LoginResponse>;
|
|
471
|
+
sendMagicLink: (request: SendMagicLinkRequest) => Promise<void>;
|
|
472
|
+
verifyMagicLink: (request: VerifyMagicLinkRequest) => Promise<_atzentis_auth_sdk.LoginResponse>;
|
|
473
|
+
isUsernameAvailable: (username: string) => Promise<boolean>;
|
|
474
|
+
getAccessToken: () => Promise<string | null>;
|
|
475
|
+
refreshToken: () => Promise<_atzentis_auth_sdk.RefreshTokenResponse>;
|
|
476
|
+
getAuthHeader: () => Promise<{
|
|
477
|
+
Authorization: string;
|
|
478
|
+
} | {
|
|
479
|
+
Authorization?: undefined;
|
|
480
|
+
}>;
|
|
44
481
|
clearError: () => void;
|
|
45
482
|
};
|
|
46
483
|
|
|
47
484
|
declare function useAuthContext(): AuthContextValue;
|
|
48
485
|
|
|
486
|
+
interface UseAuthLocalizationResult {
|
|
487
|
+
localization: Required<AuthLocalization>;
|
|
488
|
+
localizeErrors: boolean;
|
|
489
|
+
}
|
|
490
|
+
declare function useAuthLocalization(): UseAuthLocalizationResult;
|
|
491
|
+
|
|
492
|
+
declare function useDevices(): {
|
|
493
|
+
devices: Device[];
|
|
494
|
+
currentDevice: Device | null;
|
|
495
|
+
isLoading: boolean;
|
|
496
|
+
error: AuthError | null;
|
|
497
|
+
refresh: () => Promise<void>;
|
|
498
|
+
trustDevice: (id: string) => Promise<void>;
|
|
499
|
+
untrustDevice: (id: string) => Promise<void>;
|
|
500
|
+
removeDevice: (id: string) => Promise<void>;
|
|
501
|
+
removeAllOtherDevices: () => Promise<void>;
|
|
502
|
+
};
|
|
503
|
+
|
|
504
|
+
interface UseLoginActivityOptions {
|
|
505
|
+
limit?: number;
|
|
506
|
+
}
|
|
507
|
+
declare function useLoginActivity(options?: UseLoginActivityOptions): {
|
|
508
|
+
events: LoginEvent[];
|
|
509
|
+
total: number;
|
|
510
|
+
hasMore: boolean;
|
|
511
|
+
isLoading: boolean;
|
|
512
|
+
error: AuthError | null;
|
|
513
|
+
refresh: () => Promise<void>;
|
|
514
|
+
loadMore: () => Promise<void>;
|
|
515
|
+
filter: (newOptions: ListLoginEventsRequest) => void;
|
|
516
|
+
markRecognized: (eventId: string) => Promise<void>;
|
|
517
|
+
reportSuspicious: (eventId: string) => Promise<_atzentis_auth_sdk.ReportSuspiciousResponse>;
|
|
518
|
+
};
|
|
519
|
+
|
|
520
|
+
declare function useOrganizations(): {
|
|
521
|
+
organizations: Organization[];
|
|
522
|
+
isLoading: boolean;
|
|
523
|
+
error: AuthError | null;
|
|
524
|
+
refresh: () => Promise<void>;
|
|
525
|
+
create: (data: CreateOrganizationRequest) => Promise<Organization>;
|
|
526
|
+
update: (orgId: string, data: UpdateOrganizationRequest) => Promise<Organization>;
|
|
527
|
+
delete: (orgId: string) => Promise<void>;
|
|
528
|
+
listMembers: (orgId: string, options?: ListMembersRequest) => Promise<_atzentis_auth_sdk.ListMembersResponse>;
|
|
529
|
+
updateMember: (orgId: string, userId: string, data: UpdateMemberRequest) => Promise<_atzentis_auth_sdk.Member>;
|
|
530
|
+
removeMember: (orgId: string, userId: string) => Promise<void>;
|
|
531
|
+
inviteMember: (orgId: string, data: InviteMemberRequest) => Promise<_atzentis_auth_sdk.Invitation>;
|
|
532
|
+
listInvitations: (orgId: string, options?: ListInvitationsRequest) => Promise<_atzentis_auth_sdk.ListInvitationsResponse>;
|
|
533
|
+
resendInvitation: (orgId: string, invitationId: string) => Promise<void>;
|
|
534
|
+
cancelInvitation: (orgId: string, invitationId: string) => Promise<void>;
|
|
535
|
+
acceptInvitation: (data: AcceptInvitationRequest) => Promise<void>;
|
|
536
|
+
declineInvitation: (data: DeclineInvitationRequest) => Promise<void>;
|
|
537
|
+
leave: (orgId: string) => Promise<void>;
|
|
538
|
+
};
|
|
539
|
+
|
|
540
|
+
declare function usePhone(): {
|
|
541
|
+
isSending: boolean;
|
|
542
|
+
isVerifying: boolean;
|
|
543
|
+
codeSent: boolean;
|
|
544
|
+
expiresIn: number | null;
|
|
545
|
+
error: AuthError | null;
|
|
546
|
+
sendOTP: (phoneNumber: string) => Promise<_atzentis_auth_sdk.SendOTPResponse>;
|
|
547
|
+
verify: (phoneNumber: string, code: string) => Promise<_atzentis_auth_sdk.VerifyOTPResponse>;
|
|
548
|
+
signIn: (phoneNumber: string, password: string) => Promise<_atzentis_auth_sdk.LoginResponse>;
|
|
549
|
+
};
|
|
550
|
+
|
|
49
551
|
declare function useSession(): {
|
|
50
552
|
user: _atzentis_auth_sdk.User | null;
|
|
51
553
|
session: _atzentis_auth_sdk.Session | null;
|
|
@@ -53,4 +555,281 @@ declare function useSession(): {
|
|
|
53
555
|
isLoading: boolean;
|
|
54
556
|
};
|
|
55
557
|
|
|
56
|
-
|
|
558
|
+
declare function useSessions(): {
|
|
559
|
+
session: Session | null;
|
|
560
|
+
sessions: Session[];
|
|
561
|
+
deviceSessions: DeviceSession[];
|
|
562
|
+
isLoading: boolean;
|
|
563
|
+
error: AuthError | null;
|
|
564
|
+
refresh: () => Promise<void>;
|
|
565
|
+
revokeSession: (id: string) => Promise<void>;
|
|
566
|
+
revokeAllSessions: (options?: RevokeAllSessionsOptions) => Promise<void>;
|
|
567
|
+
switchAccount: (sessionToken: string) => Promise<void>;
|
|
568
|
+
revokeDeviceSession: (sessionToken: string) => Promise<void>;
|
|
569
|
+
};
|
|
570
|
+
|
|
571
|
+
declare function useUser(): {
|
|
572
|
+
user: _atzentis_auth_sdk.User | null;
|
|
573
|
+
isLoading: boolean;
|
|
574
|
+
error: AuthError | null;
|
|
575
|
+
updateProfile: (data: UserUpdate) => Promise<_atzentis_auth_sdk.User>;
|
|
576
|
+
changePassword: (currentPassword: string, newPassword: string) => Promise<void>;
|
|
577
|
+
setupTwoFactor: () => Promise<_atzentis_auth_sdk.TwoFactorSetup>;
|
|
578
|
+
verifyTwoFactorSetup: (code: string) => Promise<void>;
|
|
579
|
+
disableTwoFactor: (password: string) => Promise<void>;
|
|
580
|
+
deleteAccount: (password: string, reason?: string) => Promise<void>;
|
|
581
|
+
listConnectedProviders: () => Promise<_atzentis_auth_sdk.ConnectedProvider[]>;
|
|
582
|
+
connectOAuthProvider: (data: ConnectOAuthRequest) => Promise<_atzentis_auth_sdk.ConnectedProvider>;
|
|
583
|
+
disconnectOAuthProvider: (provider: string) => Promise<void>;
|
|
584
|
+
addPhoneNumber: (phoneNumber: string) => Promise<void>;
|
|
585
|
+
verifyPhoneNumber: (code: string) => Promise<void>;
|
|
586
|
+
removePhoneNumber: (password: string) => Promise<void>;
|
|
587
|
+
};
|
|
588
|
+
|
|
589
|
+
type OAuthConfig = {
|
|
590
|
+
oauthProviders: OAuthProvider[];
|
|
591
|
+
oauthRedirectUri: string;
|
|
592
|
+
};
|
|
593
|
+
interface LoginFormBaseProps {
|
|
594
|
+
onSuccess: (user: User) => void;
|
|
595
|
+
onError?: (error: AuthError) => void;
|
|
596
|
+
enablePhone?: boolean;
|
|
597
|
+
enableForgotPassword?: boolean;
|
|
598
|
+
onForgotPasswordClick?: () => void;
|
|
599
|
+
className?: string;
|
|
600
|
+
}
|
|
601
|
+
type LoginFormProps = LoginFormBaseProps & (OAuthConfig | {
|
|
602
|
+
oauthProviders?: never;
|
|
603
|
+
});
|
|
604
|
+
interface SignupFormProps {
|
|
605
|
+
onSuccess: (user: User) => void;
|
|
606
|
+
onError?: (error: AuthError) => void;
|
|
607
|
+
showUsernameField?: boolean;
|
|
608
|
+
showPhoneField?: boolean;
|
|
609
|
+
organizationName?: string;
|
|
610
|
+
acceptTermsRequired?: boolean;
|
|
611
|
+
onLoginClick?: () => void;
|
|
612
|
+
className?: string;
|
|
613
|
+
}
|
|
614
|
+
interface PhoneLoginFormProps {
|
|
615
|
+
onSuccess: (user: User) => void;
|
|
616
|
+
onError?: (error: AuthError) => void;
|
|
617
|
+
allowedCountryCodes?: string[];
|
|
618
|
+
showPasswordFallback?: boolean;
|
|
619
|
+
autoFocusOTP?: boolean;
|
|
620
|
+
className?: string;
|
|
621
|
+
}
|
|
622
|
+
interface OAuthButtonProps {
|
|
623
|
+
provider: OAuthProvider;
|
|
624
|
+
redirectUri: string;
|
|
625
|
+
state?: string;
|
|
626
|
+
variant?: "filled" | "outline";
|
|
627
|
+
size?: "sm" | "md" | "lg";
|
|
628
|
+
className?: string;
|
|
629
|
+
}
|
|
630
|
+
interface MagicLinkFormProps {
|
|
631
|
+
redirectUrl: string;
|
|
632
|
+
onSuccess?: () => void;
|
|
633
|
+
onError?: (error: AuthError) => void;
|
|
634
|
+
className?: string;
|
|
635
|
+
}
|
|
636
|
+
interface DeviceListProps {
|
|
637
|
+
showTrustToggle?: boolean;
|
|
638
|
+
showRemoveAction?: boolean;
|
|
639
|
+
onDeviceTrusted?: (device: Device) => void;
|
|
640
|
+
onDeviceUntrusted?: (device: Device) => void;
|
|
641
|
+
onDeviceRemoved?: (device: Device) => void;
|
|
642
|
+
renderDeviceIcon?: (device: Device) => ReactNode;
|
|
643
|
+
className?: string;
|
|
644
|
+
}
|
|
645
|
+
interface LoginActivityFeedProps {
|
|
646
|
+
limit?: number;
|
|
647
|
+
showRiskBadge?: boolean;
|
|
648
|
+
showReportActions?: boolean;
|
|
649
|
+
filterByStatus?: "success" | "failed" | "blocked";
|
|
650
|
+
onSuspiciousReported?: (event: LoginEvent) => void;
|
|
651
|
+
className?: string;
|
|
652
|
+
}
|
|
653
|
+
interface AccountSwitcherProps {
|
|
654
|
+
showAddAccount?: boolean;
|
|
655
|
+
onSwitch?: (user: User) => void;
|
|
656
|
+
onAddAccount?: () => void;
|
|
657
|
+
maxAccounts?: number;
|
|
658
|
+
className?: string;
|
|
659
|
+
}
|
|
660
|
+
interface SessionGuardProps {
|
|
661
|
+
children: ReactNode;
|
|
662
|
+
fallback: ReactNode;
|
|
663
|
+
loadingFallback?: ReactNode;
|
|
664
|
+
freshRequired?: boolean;
|
|
665
|
+
freshThreshold?: number;
|
|
666
|
+
requiredRole?: string;
|
|
667
|
+
className?: string;
|
|
668
|
+
}
|
|
669
|
+
interface UserMenuProps {
|
|
670
|
+
showOrganization?: boolean;
|
|
671
|
+
menuItems?: Array<{
|
|
672
|
+
label: string;
|
|
673
|
+
onClick: () => void;
|
|
674
|
+
}>;
|
|
675
|
+
className?: string;
|
|
676
|
+
}
|
|
677
|
+
interface OrganizationMenuProps {
|
|
678
|
+
showCreateNew?: boolean;
|
|
679
|
+
currentOrgId?: string;
|
|
680
|
+
onSwitch?: (org: Organization) => void;
|
|
681
|
+
onCreateNew?: () => void;
|
|
682
|
+
className?: string;
|
|
683
|
+
}
|
|
684
|
+
interface LoadingBoundaryProps {
|
|
685
|
+
children: ReactNode;
|
|
686
|
+
spinner?: ReactNode;
|
|
687
|
+
delay?: number;
|
|
688
|
+
className?: string;
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
declare function AccountSwitcher({ showAddAccount, onSwitch, onAddAccount, maxAccounts, className, }: AccountSwitcherProps): react_jsx_runtime.JSX.Element;
|
|
692
|
+
|
|
693
|
+
declare function SessionGuard({ children, fallback, loadingFallback, freshRequired, freshThreshold, requiredRole, className, }: SessionGuardProps): react_jsx_runtime.JSX.Element;
|
|
694
|
+
|
|
695
|
+
declare function DeviceList({ showTrustToggle, showRemoveAction, onDeviceTrusted, onDeviceUntrusted, onDeviceRemoved, renderDeviceIcon, className, }: DeviceListProps): react_jsx_runtime.JSX.Element;
|
|
696
|
+
|
|
697
|
+
declare function LoadingBoundary({ children, spinner, delay, className, }: LoadingBoundaryProps): react_jsx_runtime.JSX.Element | null;
|
|
698
|
+
|
|
699
|
+
declare function LoginActivityFeed({ limit, showRiskBadge, showReportActions, filterByStatus, onSuspiciousReported, className, }: LoginActivityFeedProps): react_jsx_runtime.JSX.Element;
|
|
700
|
+
|
|
701
|
+
declare function LoginForm({ onSuccess, onError, enablePhone, enableForgotPassword, onForgotPasswordClick, className, ...oauthProps }: LoginFormProps): react_jsx_runtime.JSX.Element;
|
|
702
|
+
|
|
703
|
+
declare function MagicLinkForm({ redirectUrl, onSuccess, onError, className }: MagicLinkFormProps): react_jsx_runtime.JSX.Element;
|
|
704
|
+
|
|
705
|
+
declare function OAuthButton({ provider, redirectUri, state, variant, size, className, }: OAuthButtonProps): react_jsx_runtime.JSX.Element;
|
|
706
|
+
|
|
707
|
+
declare function PhoneLoginForm({ onSuccess, onError, allowedCountryCodes, showPasswordFallback, className, }: PhoneLoginFormProps): react_jsx_runtime.JSX.Element;
|
|
708
|
+
|
|
709
|
+
declare function SignupForm({ onSuccess, onError, showUsernameField, showPhoneField, organizationName, acceptTermsRequired, onLoginClick, className, }: SignupFormProps): react_jsx_runtime.JSX.Element;
|
|
710
|
+
|
|
711
|
+
declare function OrganizationMenu({ showCreateNew, currentOrgId, onSwitch, onCreateNew, className, }: OrganizationMenuProps): react_jsx_runtime.JSX.Element;
|
|
712
|
+
|
|
713
|
+
declare function UserMenu({ showOrganization, menuItems, className }: UserMenuProps): react_jsx_runtime.JSX.Element | null;
|
|
714
|
+
|
|
715
|
+
declare const credentialLoginSchema: z.ZodObject<{
|
|
716
|
+
identity: z.ZodString;
|
|
717
|
+
password: z.ZodString;
|
|
718
|
+
captchaToken: z.ZodOptional<z.ZodString>;
|
|
719
|
+
}, "strip", z.ZodTypeAny, {
|
|
720
|
+
password: string;
|
|
721
|
+
identity: string;
|
|
722
|
+
captchaToken?: string | undefined;
|
|
723
|
+
}, {
|
|
724
|
+
password: string;
|
|
725
|
+
identity: string;
|
|
726
|
+
captchaToken?: string | undefined;
|
|
727
|
+
}>;
|
|
728
|
+
type CredentialLoginFormData = z.infer<typeof credentialLoginSchema>;
|
|
729
|
+
declare const phoneLoginSchema: z.ZodObject<{
|
|
730
|
+
countryCode: z.ZodString;
|
|
731
|
+
phoneNumber: z.ZodString;
|
|
732
|
+
}, "strip", z.ZodTypeAny, {
|
|
733
|
+
countryCode: string;
|
|
734
|
+
phoneNumber: string;
|
|
735
|
+
}, {
|
|
736
|
+
countryCode: string;
|
|
737
|
+
phoneNumber: string;
|
|
738
|
+
}>;
|
|
739
|
+
type PhoneLoginFormData = z.infer<typeof phoneLoginSchema>;
|
|
740
|
+
declare const otpVerifySchema$1: z.ZodObject<{
|
|
741
|
+
code: z.ZodString;
|
|
742
|
+
}, "strip", z.ZodTypeAny, {
|
|
743
|
+
code: string;
|
|
744
|
+
}, {
|
|
745
|
+
code: string;
|
|
746
|
+
}>;
|
|
747
|
+
type OtpVerifyFormData$1 = z.infer<typeof otpVerifySchema$1>;
|
|
748
|
+
|
|
749
|
+
declare const magicLinkSchema: z.ZodObject<{
|
|
750
|
+
email: z.ZodString;
|
|
751
|
+
}, "strip", z.ZodTypeAny, {
|
|
752
|
+
email: string;
|
|
753
|
+
}, {
|
|
754
|
+
email: string;
|
|
755
|
+
}>;
|
|
756
|
+
type MagicLinkFormData = z.infer<typeof magicLinkSchema>;
|
|
757
|
+
|
|
758
|
+
declare const phoneNumberSchema: z.ZodObject<{
|
|
759
|
+
countryCode: z.ZodString;
|
|
760
|
+
phoneNumber: z.ZodString;
|
|
761
|
+
}, "strip", z.ZodTypeAny, {
|
|
762
|
+
countryCode: string;
|
|
763
|
+
phoneNumber: string;
|
|
764
|
+
}, {
|
|
765
|
+
countryCode: string;
|
|
766
|
+
phoneNumber: string;
|
|
767
|
+
}>;
|
|
768
|
+
type PhoneNumberFormData = z.infer<typeof phoneNumberSchema>;
|
|
769
|
+
declare const otpVerifySchema: z.ZodObject<{
|
|
770
|
+
code: z.ZodString;
|
|
771
|
+
}, "strip", z.ZodTypeAny, {
|
|
772
|
+
code: string;
|
|
773
|
+
}, {
|
|
774
|
+
code: string;
|
|
775
|
+
}>;
|
|
776
|
+
type OtpVerifyFormData = z.infer<typeof otpVerifySchema>;
|
|
777
|
+
declare const phonePasswordSchema: z.ZodObject<{
|
|
778
|
+
countryCode: z.ZodString;
|
|
779
|
+
phoneNumber: z.ZodString;
|
|
780
|
+
password: z.ZodString;
|
|
781
|
+
}, "strip", z.ZodTypeAny, {
|
|
782
|
+
password: string;
|
|
783
|
+
countryCode: string;
|
|
784
|
+
phoneNumber: string;
|
|
785
|
+
}, {
|
|
786
|
+
password: string;
|
|
787
|
+
countryCode: string;
|
|
788
|
+
phoneNumber: string;
|
|
789
|
+
}>;
|
|
790
|
+
type PhonePasswordFormData = z.infer<typeof phonePasswordSchema>;
|
|
791
|
+
|
|
792
|
+
declare const signupSchema: z.ZodObject<{
|
|
793
|
+
email: z.ZodString;
|
|
794
|
+
password: z.ZodString;
|
|
795
|
+
name: z.ZodString;
|
|
796
|
+
username: z.ZodOptional<z.ZodString>;
|
|
797
|
+
phoneNumber: z.ZodOptional<z.ZodString>;
|
|
798
|
+
organizationName: z.ZodOptional<z.ZodString>;
|
|
799
|
+
acceptTerms: z.ZodBoolean;
|
|
800
|
+
captchaToken: z.ZodOptional<z.ZodString>;
|
|
801
|
+
}, "strip", z.ZodTypeAny, {
|
|
802
|
+
password: string;
|
|
803
|
+
name: string;
|
|
804
|
+
email: string;
|
|
805
|
+
acceptTerms: boolean;
|
|
806
|
+
captchaToken?: string | undefined;
|
|
807
|
+
phoneNumber?: string | undefined;
|
|
808
|
+
username?: string | undefined;
|
|
809
|
+
organizationName?: string | undefined;
|
|
810
|
+
}, {
|
|
811
|
+
password: string;
|
|
812
|
+
name: string;
|
|
813
|
+
email: string;
|
|
814
|
+
acceptTerms: boolean;
|
|
815
|
+
captchaToken?: string | undefined;
|
|
816
|
+
phoneNumber?: string | undefined;
|
|
817
|
+
username?: string | undefined;
|
|
818
|
+
organizationName?: string | undefined;
|
|
819
|
+
}>;
|
|
820
|
+
type SignupFormData = z.infer<typeof signupSchema>;
|
|
821
|
+
|
|
822
|
+
declare function getInitials(name: string): string;
|
|
823
|
+
|
|
824
|
+
/**
|
|
825
|
+
* Safely converts an unknown caught value to AuthError.
|
|
826
|
+
* If the value is already an AuthError, returns it directly.
|
|
827
|
+
* Otherwise wraps the message in a new AuthError.
|
|
828
|
+
*/
|
|
829
|
+
declare function toAuthError(error: unknown): AuthError;
|
|
830
|
+
|
|
831
|
+
type RiskLevel = "low" | "medium" | "high";
|
|
832
|
+
declare function getRiskLevel(score: number): RiskLevel;
|
|
833
|
+
declare const RISK_COLORS: Record<RiskLevel, string>;
|
|
834
|
+
|
|
835
|
+
export { AUTH_ERROR_CODES, AccountSwitcher, type AccountSwitcherProps, AuthContext, type AuthContextValue, type AuthLocalization, AuthProvider, type AuthProviderProps, type CredentialLoginFormData, DeviceList, type DeviceListProps, LoadingBoundary, type LoadingBoundaryProps, LocalizationContext, type LocalizationContextValue, LoginActivityFeed, type LoginActivityFeedProps, LoginForm, type LoginFormProps, MagicLinkForm, type MagicLinkFormData, type MagicLinkFormProps, OAuthButton, type OAuthButtonProps, OrganizationMenu, type OrganizationMenuProps, type OtpVerifyFormData$1 as OtpVerifyFormData, PhoneLoginForm, type PhoneLoginFormData, type PhoneLoginFormProps, type PhoneNumberFormData, type OtpVerifyFormData as PhoneOtpVerifyFormData, type PhonePasswordFormData, RISK_COLORS, type RiskLevel, SessionGuard, type SessionGuardProps, SignupForm, type SignupFormData, type SignupFormProps, UserMenu, type UserMenuProps, authLocalization, credentialLoginSchema, getInitials, getLocalizedError, getRiskLevel, magicLinkSchema, otpVerifySchema$1 as otpVerifySchema, phoneLoginSchema, phoneNumberSchema, otpVerifySchema as phoneOtpVerifySchema, phonePasswordSchema, signupSchema, toAuthError, useApiKeys, useAuth, useAuthContext, useAuthLocalization, useDevices, useLoginActivity, useOrganizations, usePhone, useSession, useSessions, useUser };
|