@atzentis/auth-react 0.0.13 → 0.0.15
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 +946 -15
- package/dist/index.js +2925 -14
- package/dist/index.js.map +1 -1
- package/dist/server.d.ts +48 -0
- package/dist/server.js +24 -0
- package/dist/server.js.map +1 -0
- package/package.json +22 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,456 @@
|
|
|
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, ApiKey, CreateApiKeyRequest, UpdateApiKeyRequest, LoginCredentials, UsernameLoginCredentials,
|
|
5
|
+
import { AuthClient, User, Session, AuthError, LoginAlert, ITokenStorage, ApiKey, CreateApiKeyRequest, UpdateApiKeyRequest, GetOAuthUrlRequest, LoginCredentials, UsernameLoginCredentials, RequestPasswordResetRequest, ResetPasswordRequest, SendMagicLinkRequest, SendVerificationEmailRequest, SignupData, VerifyEmailRequest, VerifyMagicLinkRequest, VerifyOAuthCodeRequest, 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 "Confirm new password" */
|
|
213
|
+
CONFIRM_NEW_PASSWORD: string;
|
|
214
|
+
/** @default "Set Password" */
|
|
215
|
+
SET_PASSWORD: string;
|
|
216
|
+
/** @default "Click the button to receive an email to set your password" */
|
|
217
|
+
SET_PASSWORD_DESCRIPTION: string;
|
|
218
|
+
/** @default "Check your email" */
|
|
219
|
+
CHECK_YOUR_EMAIL: string;
|
|
220
|
+
/** @default "Resend in {{seconds}}s" */
|
|
221
|
+
RESEND_IN: string;
|
|
222
|
+
/** @default "Email Verification" */
|
|
223
|
+
EMAIL_VERIFICATION: string;
|
|
224
|
+
/** @default "Verify your email address" */
|
|
225
|
+
EMAIL_VERIFICATION_DESCRIPTION: string;
|
|
226
|
+
/** @default "Email verified successfully" */
|
|
227
|
+
EMAIL_VERIFICATION_SUCCESS: string;
|
|
228
|
+
/** @default "Verifying your email..." */
|
|
229
|
+
EMAIL_VERIFICATION_CHECKING: string;
|
|
230
|
+
/** @default "Resend verification email" */
|
|
231
|
+
RESEND_VERIFICATION_EMAIL: string;
|
|
232
|
+
/** @default "Verification email sent" */
|
|
233
|
+
VERIFICATION_EMAIL_SENT: string;
|
|
234
|
+
/** @default "Email Code Verification" */
|
|
235
|
+
EMAIL_OTP: string;
|
|
236
|
+
/** @default "Enter your email to receive a verification code" */
|
|
237
|
+
EMAIL_OTP_DESCRIPTION: string;
|
|
238
|
+
/** @default "We sent a code to" */
|
|
239
|
+
EMAIL_OTP_SENT: string;
|
|
240
|
+
/** @default "Enter the 6-digit code" */
|
|
241
|
+
ENTER_VERIFICATION_CODE: string;
|
|
242
|
+
/** @default "Recover Account" */
|
|
243
|
+
RECOVER_ACCOUNT: string;
|
|
244
|
+
/** @default "Recover access to your account" */
|
|
245
|
+
RECOVER_ACCOUNT_DESCRIPTION: string;
|
|
246
|
+
/** @default "Select recovery method" */
|
|
247
|
+
SELECT_RECOVERY_METHOD: string;
|
|
248
|
+
/** @default "Reset via email link" */
|
|
249
|
+
RESET_VIA_EMAIL: string;
|
|
250
|
+
/** @default "Verify with email code" */
|
|
251
|
+
VERIFY_WITH_CODE: string;
|
|
252
|
+
/** @default "Verify via phone" */
|
|
253
|
+
VERIFY_VIA_PHONE: string;
|
|
254
|
+
/** @default "Step {{current}} of {{total}}" */
|
|
255
|
+
STEP_OF: string;
|
|
256
|
+
/** @default "Current Session" */
|
|
257
|
+
CURRENT_SESSION: string;
|
|
258
|
+
/** @default "Current device" */
|
|
259
|
+
CURRENT_DEVICE: string;
|
|
260
|
+
/** @default "Sessions" */
|
|
261
|
+
SESSIONS: string;
|
|
262
|
+
/** @default "Manage your active sessions" */
|
|
263
|
+
SESSIONS_DESCRIPTION: string;
|
|
264
|
+
/** @default "Trust" */
|
|
265
|
+
TRUST_DEVICE: string;
|
|
266
|
+
/** @default "Untrust" */
|
|
267
|
+
UNTRUST_DEVICE: string;
|
|
268
|
+
/** @default "Loading devices..." */
|
|
269
|
+
LOADING_DEVICES: string;
|
|
270
|
+
/** @default "No devices found" */
|
|
271
|
+
NO_DEVICES: string;
|
|
272
|
+
/** @default "Last used:" */
|
|
273
|
+
LAST_USED: string;
|
|
274
|
+
/** @default "IP:" */
|
|
275
|
+
IP_LABEL: string;
|
|
276
|
+
/** @default "Security" */
|
|
277
|
+
SECURITY: string;
|
|
278
|
+
/** @default "Session not fresh. Please sign in again." */
|
|
279
|
+
SESSION_NOT_FRESH: string;
|
|
280
|
+
/** @default "Login Activity" */
|
|
281
|
+
LOGIN_ACTIVITY: string;
|
|
282
|
+
/** @default "Recent login attempts" */
|
|
283
|
+
LOGIN_ACTIVITY_DESCRIPTION: string;
|
|
284
|
+
/** @default "Low" */
|
|
285
|
+
RISK_LOW: string;
|
|
286
|
+
/** @default "Medium" */
|
|
287
|
+
RISK_MEDIUM: string;
|
|
288
|
+
/** @default "High" */
|
|
289
|
+
RISK_HIGH: string;
|
|
290
|
+
/** @default "This was me" */
|
|
291
|
+
MARK_RECOGNIZED: string;
|
|
292
|
+
/** @default "Not me" */
|
|
293
|
+
REPORT_SUSPICIOUS: string;
|
|
294
|
+
/** @default "Loading activity..." */
|
|
295
|
+
LOADING_ACTIVITY: string;
|
|
296
|
+
/** @default "No login activity found" */
|
|
297
|
+
NO_ACTIVITY: string;
|
|
298
|
+
/** @default "Accounts" */
|
|
299
|
+
ACCOUNTS: string;
|
|
300
|
+
/** @default "Manage signed in accounts" */
|
|
301
|
+
ACCOUNTS_DESCRIPTION: string;
|
|
302
|
+
/** @default "Add account" */
|
|
303
|
+
ADD_ACCOUNT: string;
|
|
304
|
+
/** @default "Switch Account" */
|
|
305
|
+
SWITCH_ACCOUNT: string;
|
|
306
|
+
/** @default "Select account" */
|
|
307
|
+
SELECT_ACCOUNT: string;
|
|
308
|
+
/** @default "Personal Account" */
|
|
309
|
+
PERSONAL_ACCOUNT: string;
|
|
310
|
+
/** @default "Sign out" */
|
|
311
|
+
SIGN_OUT: string;
|
|
312
|
+
/** @default "Organization" */
|
|
313
|
+
ORGANIZATION: string;
|
|
314
|
+
/** @default "Organizations" */
|
|
315
|
+
ORGANIZATIONS: string;
|
|
316
|
+
/** @default "Manage your organizations" */
|
|
317
|
+
ORGANIZATIONS_DESCRIPTION: string;
|
|
318
|
+
/** @default "Select organization" */
|
|
319
|
+
SELECT_ORGANIZATION: string;
|
|
320
|
+
/** @default "Create organization" */
|
|
321
|
+
CREATE_ORGANIZATION: string;
|
|
322
|
+
/** @default "Name" */
|
|
323
|
+
ORGANIZATION_NAME: string;
|
|
324
|
+
/** @default "Acme Inc." */
|
|
325
|
+
ORGANIZATION_NAME_PLACEHOLDER: string;
|
|
326
|
+
/** @default "Leave Organization" */
|
|
327
|
+
LEAVE_ORGANIZATION: string;
|
|
328
|
+
/** @default "Delete Organization" */
|
|
329
|
+
DELETE_ORGANIZATION: string;
|
|
330
|
+
/** @default "Members" */
|
|
331
|
+
MEMBERS: string;
|
|
332
|
+
/** @default "Invite Member" */
|
|
333
|
+
INVITE_MEMBER: string;
|
|
334
|
+
/** @default "Remove Member" */
|
|
335
|
+
REMOVE_MEMBER: string;
|
|
336
|
+
/** @default "Role" */
|
|
337
|
+
ROLE: string;
|
|
338
|
+
/** @default "Admin" */
|
|
339
|
+
ADMIN: string;
|
|
340
|
+
/** @default "Member" */
|
|
341
|
+
MEMBER: string;
|
|
342
|
+
/** @default "Owner" */
|
|
343
|
+
OWNER: string;
|
|
344
|
+
/** @default "Settings" */
|
|
345
|
+
SETTINGS: string;
|
|
346
|
+
/** @default "Account" */
|
|
347
|
+
ACCOUNT: string;
|
|
348
|
+
/** @default "Avatar" */
|
|
349
|
+
AVATAR: string;
|
|
350
|
+
/** @default "Click avatar to upload a custom one" */
|
|
351
|
+
AVATAR_DESCRIPTION: string;
|
|
352
|
+
/** @default "Delete Avatar" */
|
|
353
|
+
DELETE_AVATAR: string;
|
|
354
|
+
/** @default "Upload Avatar" */
|
|
355
|
+
UPLOAD_AVATAR: string;
|
|
356
|
+
/** @default "Email" */
|
|
357
|
+
EMAIL: string;
|
|
358
|
+
/** @default "Name" */
|
|
359
|
+
NAME: string;
|
|
360
|
+
/** @default "Two-Factor" */
|
|
361
|
+
TWO_FACTOR: string;
|
|
362
|
+
/** @default "Two-Factor Authentication" */
|
|
363
|
+
TWO_FACTOR_PROMPT: string;
|
|
364
|
+
/** @default "Enter your one-time password" */
|
|
365
|
+
TWO_FACTOR_DESCRIPTION: string;
|
|
366
|
+
/** @default "Verify code" */
|
|
367
|
+
TWO_FACTOR_ACTION: string;
|
|
368
|
+
/** @default "Two-factor authentication has been enabled" */
|
|
369
|
+
TWO_FACTOR_ENABLED: string;
|
|
370
|
+
/** @default "Two-factor authentication has been disabled" */
|
|
371
|
+
TWO_FACTOR_DISABLED: string;
|
|
372
|
+
/** @default "Enable Two-Factor" */
|
|
373
|
+
ENABLE_TWO_FACTOR: string;
|
|
374
|
+
/** @default "Disable Two-Factor" */
|
|
375
|
+
DISABLE_TWO_FACTOR: string;
|
|
376
|
+
/** @default "Backup Codes" */
|
|
377
|
+
BACKUP_CODES: string;
|
|
378
|
+
/** @default "Save these codes in a secure place" */
|
|
379
|
+
BACKUP_CODES_DESCRIPTION: string;
|
|
380
|
+
/** @default "Enter your 6-digit code" */
|
|
381
|
+
ENTER_TOTP_CODE: string;
|
|
382
|
+
/** @default "Use backup code" */
|
|
383
|
+
USE_BACKUP_CODE: string;
|
|
384
|
+
/** @default "Use authenticator" */
|
|
385
|
+
USE_AUTHENTICATOR: string;
|
|
386
|
+
/** @default "Enter backup code" */
|
|
387
|
+
BACKUP_CODE_PLACEHOLDER: string;
|
|
388
|
+
/** @default "Passwords do not match" */
|
|
389
|
+
PASSWORDS_DO_NOT_MATCH: string;
|
|
390
|
+
/** @default "Password is required" */
|
|
391
|
+
PASSWORD_REQUIRED: string;
|
|
392
|
+
/** @default "Email address is required" */
|
|
393
|
+
EMAIL_REQUIRED: string;
|
|
394
|
+
/** @default "is required" */
|
|
395
|
+
IS_REQUIRED: string;
|
|
396
|
+
/** @default "is invalid" */
|
|
397
|
+
IS_INVALID: string;
|
|
398
|
+
};
|
|
399
|
+
type AuthLocalization = Partial<typeof authLocalization>;
|
|
400
|
+
|
|
401
|
+
declare const AUTH_ERROR_CODES: {
|
|
402
|
+
INVALID_CREDENTIALS: string;
|
|
403
|
+
EMAIL_NOT_VERIFIED: string;
|
|
404
|
+
TWO_FACTOR_REQUIRED: string;
|
|
405
|
+
INVALID_PHONE_NUMBER: string;
|
|
406
|
+
OTP_EXPIRED: string;
|
|
407
|
+
OTP_INVALID: string;
|
|
408
|
+
OTP_MAX_ATTEMPTS: string;
|
|
409
|
+
PHONE_NUMBER_IN_USE: string;
|
|
410
|
+
FRAUD_DETECTED: string;
|
|
411
|
+
USERNAME_TAKEN: string;
|
|
412
|
+
USERNAME_INVALID: string;
|
|
413
|
+
USERNAME_RESERVED: string;
|
|
414
|
+
DEVICE_NOT_FOUND: string;
|
|
415
|
+
LOGIN_EVENT_NOT_FOUND: string;
|
|
416
|
+
REAUTH_REQUIRED: string;
|
|
417
|
+
MAX_SESSIONS_EXCEEDED: string;
|
|
418
|
+
CAPTCHA_REQUIRED: string;
|
|
419
|
+
CAPTCHA_INVALID: string;
|
|
420
|
+
PASSWORD_BREACHED: string;
|
|
421
|
+
SESSION_EXPIRED: string;
|
|
422
|
+
TOKEN_EXPIRED: string;
|
|
423
|
+
INVALID_TOKEN: string;
|
|
424
|
+
UNAUTHORIZED_ROLE: string;
|
|
425
|
+
ORGANIZATION_NOT_FOUND: string;
|
|
426
|
+
PERMISSION_DENIED: string;
|
|
427
|
+
RATE_LIMITED: string;
|
|
428
|
+
NETWORK_ERROR: string;
|
|
429
|
+
TIMEOUT: string;
|
|
430
|
+
USER_NOT_FOUND: string;
|
|
431
|
+
USER_ALREADY_EXISTS: string;
|
|
432
|
+
INVALID_EMAIL: string;
|
|
433
|
+
WEAK_PASSWORD: string;
|
|
434
|
+
ORG_LIMIT_EXCEEDED: string;
|
|
435
|
+
MEMBER_LIMIT_EXCEEDED: string;
|
|
436
|
+
KEY_NOT_FOUND: string;
|
|
437
|
+
KEY_REVOKED: string;
|
|
438
|
+
KEY_EXPIRED: string;
|
|
439
|
+
};
|
|
440
|
+
|
|
441
|
+
/**
|
|
442
|
+
* Gets a localized error message from an error object.
|
|
443
|
+
*
|
|
444
|
+
* When `localizeErrors` is true, looks up the error code directly
|
|
445
|
+
* in the localization dictionary (error codes are localization keys).
|
|
446
|
+
*
|
|
447
|
+
* Fallback chain:
|
|
448
|
+
* 1. localization[error.code] (if AuthError and localizeErrors)
|
|
449
|
+
* 2. error.message
|
|
450
|
+
* 3. localization.REQUEST_FAILED
|
|
451
|
+
* 4. "Request failed"
|
|
452
|
+
*/
|
|
453
|
+
declare function getLocalizedError(error: unknown, localization: AuthLocalization, localizeErrors: boolean): string;
|
|
5
454
|
|
|
6
455
|
interface AuthProviderProps {
|
|
7
456
|
apiKey?: string;
|
|
@@ -17,6 +466,8 @@ interface AuthProviderProps {
|
|
|
17
466
|
initialToken?: string;
|
|
18
467
|
initialUser?: User;
|
|
19
468
|
storage?: ITokenStorage;
|
|
469
|
+
localization?: AuthLocalization;
|
|
470
|
+
localizeErrors?: boolean;
|
|
20
471
|
}
|
|
21
472
|
interface AuthContextValue {
|
|
22
473
|
client: AuthClient;
|
|
@@ -32,7 +483,12 @@ interface AuthContextValue {
|
|
|
32
483
|
}
|
|
33
484
|
|
|
34
485
|
declare const AuthContext: react.Context<AuthContextValue | null>;
|
|
35
|
-
|
|
486
|
+
interface LocalizationContextValue {
|
|
487
|
+
overrides: AuthLocalization | null;
|
|
488
|
+
localizeErrors: boolean;
|
|
489
|
+
}
|
|
490
|
+
declare const LocalizationContext: react.Context<LocalizationContextValue>;
|
|
491
|
+
declare function AuthProvider({ apiKey, baseUrl, autoRefreshToken, refreshThreshold, timeout, collectDeviceSignals, onSessionExpired, onTokenRefreshed, onNewDeviceAlert, children, initialUser, storage, localization, localizeErrors, }: AuthProviderProps): react_jsx_runtime.JSX.Element;
|
|
36
492
|
|
|
37
493
|
declare function useApiKeys(): {
|
|
38
494
|
apiKeys: ApiKey[];
|
|
@@ -53,28 +509,38 @@ declare function useAuth(): {
|
|
|
53
509
|
isAuthenticated: boolean;
|
|
54
510
|
isLoading: boolean;
|
|
55
511
|
error: _atzentis_auth_sdk.AuthError | null;
|
|
56
|
-
|
|
57
|
-
loginWithUsername: (credentials: UsernameLoginCredentials) => Promise<_atzentis_auth_sdk.LoginResponse>;
|
|
58
|
-
signup: (data: SignupData) => Promise<_atzentis_auth_sdk.SignupResponse>;
|
|
59
|
-
logout: () => Promise<void>;
|
|
60
|
-
logoutAllDevices: () => Promise<void>;
|
|
61
|
-
getOAuthUrl: (config: GetOAuthUrlRequest) => string;
|
|
62
|
-
verifyOAuthCode: (request: VerifyOAuthCodeRequest) => Promise<_atzentis_auth_sdk.LoginResponse>;
|
|
63
|
-
sendMagicLink: (request: SendMagicLinkRequest) => Promise<void>;
|
|
64
|
-
verifyMagicLink: (request: VerifyMagicLinkRequest) => Promise<_atzentis_auth_sdk.LoginResponse>;
|
|
65
|
-
isUsernameAvailable: (username: string) => Promise<boolean>;
|
|
512
|
+
clearError: () => void;
|
|
66
513
|
getAccessToken: () => Promise<string | null>;
|
|
67
|
-
refreshToken: () => Promise<_atzentis_auth_sdk.RefreshTokenResponse>;
|
|
68
514
|
getAuthHeader: () => Promise<{
|
|
69
515
|
Authorization: string;
|
|
70
516
|
} | {
|
|
71
517
|
Authorization?: undefined;
|
|
72
518
|
}>;
|
|
73
|
-
|
|
519
|
+
getOAuthUrl: (config: GetOAuthUrlRequest) => string;
|
|
520
|
+
isUsernameAvailable: (username: string) => Promise<boolean>;
|
|
521
|
+
login: (credentials: LoginCredentials) => Promise<_atzentis_auth_sdk.LoginResponse>;
|
|
522
|
+
loginWithUsername: (credentials: UsernameLoginCredentials) => Promise<_atzentis_auth_sdk.LoginResponse>;
|
|
523
|
+
logout: () => Promise<void>;
|
|
524
|
+
logoutAllDevices: () => Promise<void>;
|
|
525
|
+
refreshToken: () => Promise<_atzentis_auth_sdk.RefreshTokenResponse>;
|
|
526
|
+
requestPasswordReset: (request: RequestPasswordResetRequest) => Promise<void>;
|
|
527
|
+
resetPassword: (request: ResetPasswordRequest) => Promise<_atzentis_auth_sdk.ResetPasswordResponse>;
|
|
528
|
+
sendMagicLink: (request: SendMagicLinkRequest) => Promise<void>;
|
|
529
|
+
sendVerificationEmail: (request: SendVerificationEmailRequest) => Promise<void>;
|
|
530
|
+
signup: (data: SignupData) => Promise<_atzentis_auth_sdk.SignupResponse>;
|
|
531
|
+
verifyEmail: (request: VerifyEmailRequest) => Promise<_atzentis_auth_sdk.VerifyEmailResponse>;
|
|
532
|
+
verifyMagicLink: (request: VerifyMagicLinkRequest) => Promise<_atzentis_auth_sdk.LoginResponse>;
|
|
533
|
+
verifyOAuthCode: (request: VerifyOAuthCodeRequest) => Promise<_atzentis_auth_sdk.LoginResponse>;
|
|
74
534
|
};
|
|
75
535
|
|
|
76
536
|
declare function useAuthContext(): AuthContextValue;
|
|
77
537
|
|
|
538
|
+
interface UseAuthLocalizationResult {
|
|
539
|
+
localization: Required<AuthLocalization>;
|
|
540
|
+
localizeErrors: boolean;
|
|
541
|
+
}
|
|
542
|
+
declare function useAuthLocalization(): UseAuthLocalizationResult;
|
|
543
|
+
|
|
78
544
|
declare function useDevices(): {
|
|
79
545
|
devices: Device[];
|
|
80
546
|
currentDevice: Device | null;
|
|
@@ -172,4 +638,469 @@ declare function useUser(): {
|
|
|
172
638
|
removePhoneNumber: (password: string) => Promise<void>;
|
|
173
639
|
};
|
|
174
640
|
|
|
175
|
-
|
|
641
|
+
type OAuthConfig = {
|
|
642
|
+
oauthProviders: OAuthProvider[];
|
|
643
|
+
oauthRedirectUri: string;
|
|
644
|
+
};
|
|
645
|
+
interface LoginFormBaseProps {
|
|
646
|
+
onSuccess: (user: User) => void;
|
|
647
|
+
onError?: (error: AuthError) => void;
|
|
648
|
+
enablePhone?: boolean;
|
|
649
|
+
enableForgotPassword?: boolean;
|
|
650
|
+
onForgotPasswordClick?: () => void;
|
|
651
|
+
className?: string;
|
|
652
|
+
}
|
|
653
|
+
type LoginFormProps = LoginFormBaseProps & (OAuthConfig | {
|
|
654
|
+
oauthProviders?: never;
|
|
655
|
+
});
|
|
656
|
+
interface SignupFormProps {
|
|
657
|
+
onSuccess: (user: User) => void;
|
|
658
|
+
onError?: (error: AuthError) => void;
|
|
659
|
+
showUsernameField?: boolean;
|
|
660
|
+
showPhoneField?: boolean;
|
|
661
|
+
organizationName?: string;
|
|
662
|
+
acceptTermsRequired?: boolean;
|
|
663
|
+
onLoginClick?: () => void;
|
|
664
|
+
className?: string;
|
|
665
|
+
}
|
|
666
|
+
interface PhoneLoginFormProps {
|
|
667
|
+
onSuccess: (user: User) => void;
|
|
668
|
+
onError?: (error: AuthError) => void;
|
|
669
|
+
allowedCountryCodes?: string[];
|
|
670
|
+
showPasswordFallback?: boolean;
|
|
671
|
+
autoFocusOTP?: boolean;
|
|
672
|
+
className?: string;
|
|
673
|
+
}
|
|
674
|
+
interface OAuthButtonProps {
|
|
675
|
+
provider: OAuthProvider;
|
|
676
|
+
redirectUri: string;
|
|
677
|
+
state?: string;
|
|
678
|
+
variant?: "filled" | "outline";
|
|
679
|
+
size?: "sm" | "md" | "lg";
|
|
680
|
+
className?: string;
|
|
681
|
+
}
|
|
682
|
+
interface MagicLinkFormProps {
|
|
683
|
+
redirectUrl: string;
|
|
684
|
+
onSuccess?: () => void;
|
|
685
|
+
onError?: (error: AuthError) => void;
|
|
686
|
+
className?: string;
|
|
687
|
+
}
|
|
688
|
+
interface DeviceListProps {
|
|
689
|
+
showTrustToggle?: boolean;
|
|
690
|
+
showRemoveAction?: boolean;
|
|
691
|
+
onDeviceTrusted?: (device: Device) => void;
|
|
692
|
+
onDeviceUntrusted?: (device: Device) => void;
|
|
693
|
+
onDeviceRemoved?: (device: Device) => void;
|
|
694
|
+
renderDeviceIcon?: (device: Device) => ReactNode;
|
|
695
|
+
className?: string;
|
|
696
|
+
}
|
|
697
|
+
interface LoginActivityFeedProps {
|
|
698
|
+
limit?: number;
|
|
699
|
+
showRiskBadge?: boolean;
|
|
700
|
+
showReportActions?: boolean;
|
|
701
|
+
filterByStatus?: "success" | "failed" | "blocked";
|
|
702
|
+
onSuspiciousReported?: (event: LoginEvent) => void;
|
|
703
|
+
className?: string;
|
|
704
|
+
}
|
|
705
|
+
interface AccountSwitcherProps {
|
|
706
|
+
showAddAccount?: boolean;
|
|
707
|
+
onSwitch?: (user: User) => void;
|
|
708
|
+
onAddAccount?: () => void;
|
|
709
|
+
maxAccounts?: number;
|
|
710
|
+
className?: string;
|
|
711
|
+
}
|
|
712
|
+
interface SessionGuardProps {
|
|
713
|
+
children: ReactNode;
|
|
714
|
+
fallback: ReactNode;
|
|
715
|
+
loadingFallback?: ReactNode;
|
|
716
|
+
freshRequired?: boolean;
|
|
717
|
+
freshThreshold?: number;
|
|
718
|
+
requiredRole?: string;
|
|
719
|
+
className?: string;
|
|
720
|
+
}
|
|
721
|
+
interface UserMenuProps {
|
|
722
|
+
showOrganization?: boolean;
|
|
723
|
+
menuItems?: Array<{
|
|
724
|
+
label: string;
|
|
725
|
+
onClick: () => void;
|
|
726
|
+
}>;
|
|
727
|
+
className?: string;
|
|
728
|
+
}
|
|
729
|
+
interface OrganizationMenuProps {
|
|
730
|
+
showCreateNew?: boolean;
|
|
731
|
+
currentOrgId?: string;
|
|
732
|
+
onSwitch?: (org: Organization) => void;
|
|
733
|
+
onCreateNew?: () => void;
|
|
734
|
+
className?: string;
|
|
735
|
+
}
|
|
736
|
+
interface ForgotPasswordFormProps {
|
|
737
|
+
redirectUrl: string;
|
|
738
|
+
onSuccess?: () => void;
|
|
739
|
+
onError?: (error: AuthError) => void;
|
|
740
|
+
onBackToLogin?: () => void;
|
|
741
|
+
resendCooldown?: number;
|
|
742
|
+
className?: string;
|
|
743
|
+
}
|
|
744
|
+
interface TwoFactorFormProps {
|
|
745
|
+
onVerify: (code: string) => void | Promise<void>;
|
|
746
|
+
onError?: (error: AuthError) => void;
|
|
747
|
+
autoSubmit?: boolean;
|
|
748
|
+
isLoading?: boolean;
|
|
749
|
+
className?: string;
|
|
750
|
+
}
|
|
751
|
+
interface EmailVerificationFormProps {
|
|
752
|
+
token?: string;
|
|
753
|
+
email?: string;
|
|
754
|
+
redirectUrl: string;
|
|
755
|
+
onSuccess?: (user: User) => void;
|
|
756
|
+
onError?: (error: AuthError) => void;
|
|
757
|
+
resendCooldown?: number;
|
|
758
|
+
className?: string;
|
|
759
|
+
}
|
|
760
|
+
interface EmailOTPFormProps {
|
|
761
|
+
redirectUrl: string;
|
|
762
|
+
onSuccess?: (user: User) => void;
|
|
763
|
+
onError?: (error: AuthError) => void;
|
|
764
|
+
resendCooldown?: number;
|
|
765
|
+
autoSubmit?: boolean;
|
|
766
|
+
className?: string;
|
|
767
|
+
}
|
|
768
|
+
interface ResetPasswordFormProps {
|
|
769
|
+
token: string;
|
|
770
|
+
onSuccess?: () => void;
|
|
771
|
+
onError?: (error: AuthError) => void;
|
|
772
|
+
className?: string;
|
|
773
|
+
}
|
|
774
|
+
interface RecoverAccountFormProps {
|
|
775
|
+
redirectUrl: string;
|
|
776
|
+
enablePhone?: boolean;
|
|
777
|
+
onSuccess?: () => void;
|
|
778
|
+
onError?: (error: AuthError) => void;
|
|
779
|
+
resendCooldown?: number;
|
|
780
|
+
className?: string;
|
|
781
|
+
}
|
|
782
|
+
interface LoadingBoundaryProps {
|
|
783
|
+
children: ReactNode;
|
|
784
|
+
spinner?: ReactNode;
|
|
785
|
+
delay?: number;
|
|
786
|
+
className?: string;
|
|
787
|
+
}
|
|
788
|
+
type AuthViewPath = "/sign-in" | "/sign-up" | "/forgot-password" | "/reset-password" | "/verify-email" | "/email-otp" | "/recover-account" | "/two-factor";
|
|
789
|
+
interface AuthViewProps {
|
|
790
|
+
pathname: string;
|
|
791
|
+
paths?: Partial<Record<AuthViewPath, string>>;
|
|
792
|
+
fallback?: ReactNode;
|
|
793
|
+
searchParams?: Record<string, string | undefined>;
|
|
794
|
+
getSearchParam?: (key: string) => string | undefined;
|
|
795
|
+
onSuccess?: (userOrVoid?: User) => void;
|
|
796
|
+
onError?: (error: AuthError) => void;
|
|
797
|
+
enablePhone?: boolean;
|
|
798
|
+
oauthProviders?: OAuthProvider[];
|
|
799
|
+
oauthRedirectUri?: string;
|
|
800
|
+
redirectUrl?: string;
|
|
801
|
+
className?: string;
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
declare function AccountSwitcher({ showAddAccount, onSwitch, onAddAccount, maxAccounts, className, }: AccountSwitcherProps): react_jsx_runtime.JSX.Element;
|
|
805
|
+
|
|
806
|
+
declare function SessionGuard({ children, fallback, loadingFallback, freshRequired, freshThreshold, requiredRole, className, }: SessionGuardProps): react_jsx_runtime.JSX.Element;
|
|
807
|
+
|
|
808
|
+
/**
|
|
809
|
+
* AuthView — Pathname-based router for auth flows.
|
|
810
|
+
* Renders the appropriate auth form component based on the pathname prop.
|
|
811
|
+
*
|
|
812
|
+
* @example
|
|
813
|
+
* // Next.js App Router:
|
|
814
|
+
* import { AuthView } from "@atzentis/auth-react";
|
|
815
|
+
*
|
|
816
|
+
* export default function AuthPage({ params, searchParams }) {
|
|
817
|
+
* const pathname = `/${params.slug?.join("/") || ""}`;
|
|
818
|
+
* return <AuthView pathname={pathname} searchParams={searchParams} />;
|
|
819
|
+
* }
|
|
820
|
+
*
|
|
821
|
+
* @example
|
|
822
|
+
* // Custom path mapping:
|
|
823
|
+
* <AuthView
|
|
824
|
+
* pathname="/login"
|
|
825
|
+
* paths={{ "/sign-in": "/login", "/sign-up": "/register" }}
|
|
826
|
+
* onSuccess={(user) => router.push("/dashboard")}
|
|
827
|
+
* />
|
|
828
|
+
*/
|
|
829
|
+
declare function AuthView({ pathname, paths, fallback, searchParams, getSearchParam, onSuccess, onError, enablePhone, oauthProviders, oauthRedirectUri, redirectUrl, className, }: AuthViewProps): react_jsx_runtime.JSX.Element;
|
|
830
|
+
|
|
831
|
+
/**
|
|
832
|
+
* Default path mapping for AuthView component.
|
|
833
|
+
* Maps logical auth flow paths to actual URL paths.
|
|
834
|
+
*
|
|
835
|
+
* @example
|
|
836
|
+
* // Use in Next.js App Router:
|
|
837
|
+
* <AuthView pathname={pathname} paths={authViewPaths} />
|
|
838
|
+
*
|
|
839
|
+
* // Override specific paths:
|
|
840
|
+
* <AuthView
|
|
841
|
+
* pathname={pathname}
|
|
842
|
+
* paths={{ ...authViewPaths, "/sign-in": "/login" }}
|
|
843
|
+
* />
|
|
844
|
+
*/
|
|
845
|
+
declare const authViewPaths: Record<AuthViewPath, string>;
|
|
846
|
+
|
|
847
|
+
declare function EmailOTPForm({ redirectUrl, onSuccess, onError, resendCooldown, autoSubmit, className, }: EmailOTPFormProps): react_jsx_runtime.JSX.Element;
|
|
848
|
+
|
|
849
|
+
declare function EmailVerificationForm({ token, email, redirectUrl, onSuccess, onError, resendCooldown, className, }: EmailVerificationFormProps): react_jsx_runtime.JSX.Element;
|
|
850
|
+
|
|
851
|
+
declare function ForgotPasswordForm({ redirectUrl, onSuccess, onError, onBackToLogin, resendCooldown, className, }: ForgotPasswordFormProps): react_jsx_runtime.JSX.Element;
|
|
852
|
+
|
|
853
|
+
declare function LoginForm({ onSuccess, onError, enablePhone, enableForgotPassword, onForgotPasswordClick, className, ...oauthProps }: LoginFormProps): react_jsx_runtime.JSX.Element;
|
|
854
|
+
|
|
855
|
+
declare function MagicLinkForm({ redirectUrl, onSuccess, onError, className }: MagicLinkFormProps): react_jsx_runtime.JSX.Element;
|
|
856
|
+
|
|
857
|
+
declare function PhoneLoginForm({ onSuccess, onError, allowedCountryCodes, showPasswordFallback, className, }: PhoneLoginFormProps): react_jsx_runtime.JSX.Element;
|
|
858
|
+
|
|
859
|
+
declare function RecoverAccountForm({ redirectUrl, enablePhone, onSuccess, onError, resendCooldown, className, }: RecoverAccountFormProps): react_jsx_runtime.JSX.Element | null;
|
|
860
|
+
|
|
861
|
+
declare function ResetPasswordForm({ token, onSuccess, onError, className, }: ResetPasswordFormProps): react_jsx_runtime.JSX.Element;
|
|
862
|
+
|
|
863
|
+
declare function SignupForm({ onSuccess, onError, showUsernameField, showPhoneField, organizationName, acceptTermsRequired, onLoginClick, className, }: SignupFormProps): react_jsx_runtime.JSX.Element;
|
|
864
|
+
|
|
865
|
+
declare function TwoFactorForm({ onVerify, onError, autoSubmit, isLoading, className, }: TwoFactorFormProps): react_jsx_runtime.JSX.Element;
|
|
866
|
+
|
|
867
|
+
declare function OAuthButton({ provider, redirectUri, state, variant, size, className, }: OAuthButtonProps): react_jsx_runtime.JSX.Element;
|
|
868
|
+
|
|
869
|
+
declare function DeviceList({ showTrustToggle, showRemoveAction, onDeviceTrusted, onDeviceUntrusted, onDeviceRemoved, renderDeviceIcon, className, }: DeviceListProps): react_jsx_runtime.JSX.Element;
|
|
870
|
+
|
|
871
|
+
declare function LoadingBoundary({ children, spinner, delay, className, }: LoadingBoundaryProps): react_jsx_runtime.JSX.Element | null;
|
|
872
|
+
|
|
873
|
+
declare function isEmail(value: string): boolean;
|
|
874
|
+
declare function maskEmail(email: string): string;
|
|
875
|
+
|
|
876
|
+
declare function LoginActivityFeed({ limit, showRiskBadge, showReportActions, filterByStatus, onSuspiciousReported, className, }: LoginActivityFeedProps): react_jsx_runtime.JSX.Element;
|
|
877
|
+
|
|
878
|
+
declare function OrganizationMenu({ showCreateNew, currentOrgId, onSwitch, onCreateNew, className, }: OrganizationMenuProps): react_jsx_runtime.JSX.Element;
|
|
879
|
+
|
|
880
|
+
declare function UserMenu({ showOrganization, menuItems, className }: UserMenuProps): react_jsx_runtime.JSX.Element | null;
|
|
881
|
+
|
|
882
|
+
declare const credentialLoginSchema: z.ZodObject<{
|
|
883
|
+
identity: z.ZodString;
|
|
884
|
+
password: z.ZodString;
|
|
885
|
+
captchaToken: z.ZodOptional<z.ZodString>;
|
|
886
|
+
}, "strip", z.ZodTypeAny, {
|
|
887
|
+
password: string;
|
|
888
|
+
identity: string;
|
|
889
|
+
captchaToken?: string | undefined;
|
|
890
|
+
}, {
|
|
891
|
+
password: string;
|
|
892
|
+
identity: string;
|
|
893
|
+
captchaToken?: string | undefined;
|
|
894
|
+
}>;
|
|
895
|
+
type CredentialLoginFormData = z.infer<typeof credentialLoginSchema>;
|
|
896
|
+
declare const phoneLoginSchema: z.ZodObject<{
|
|
897
|
+
countryCode: z.ZodString;
|
|
898
|
+
phoneNumber: z.ZodString;
|
|
899
|
+
}, "strip", z.ZodTypeAny, {
|
|
900
|
+
countryCode: string;
|
|
901
|
+
phoneNumber: string;
|
|
902
|
+
}, {
|
|
903
|
+
countryCode: string;
|
|
904
|
+
phoneNumber: string;
|
|
905
|
+
}>;
|
|
906
|
+
type PhoneLoginFormData = z.infer<typeof phoneLoginSchema>;
|
|
907
|
+
declare const otpVerifySchema$1: z.ZodObject<{
|
|
908
|
+
code: z.ZodString;
|
|
909
|
+
}, "strip", z.ZodTypeAny, {
|
|
910
|
+
code: string;
|
|
911
|
+
}, {
|
|
912
|
+
code: string;
|
|
913
|
+
}>;
|
|
914
|
+
type OtpVerifyFormData$1 = z.infer<typeof otpVerifySchema$1>;
|
|
915
|
+
|
|
916
|
+
declare const emailOtpEmailSchema: z.ZodObject<{
|
|
917
|
+
email: z.ZodString;
|
|
918
|
+
}, "strip", z.ZodTypeAny, {
|
|
919
|
+
email: string;
|
|
920
|
+
}, {
|
|
921
|
+
email: string;
|
|
922
|
+
}>;
|
|
923
|
+
type EmailOtpEmailFormData = z.infer<typeof emailOtpEmailSchema>;
|
|
924
|
+
declare const emailOtpCodeSchema: z.ZodObject<{
|
|
925
|
+
code: z.ZodString;
|
|
926
|
+
}, "strip", z.ZodTypeAny, {
|
|
927
|
+
code: string;
|
|
928
|
+
}, {
|
|
929
|
+
code: string;
|
|
930
|
+
}>;
|
|
931
|
+
type EmailOtpCodeFormData = z.infer<typeof emailOtpCodeSchema>;
|
|
932
|
+
|
|
933
|
+
declare const forgotPasswordSchema: z.ZodObject<{
|
|
934
|
+
email: z.ZodString;
|
|
935
|
+
}, "strip", z.ZodTypeAny, {
|
|
936
|
+
email: string;
|
|
937
|
+
}, {
|
|
938
|
+
email: string;
|
|
939
|
+
}>;
|
|
940
|
+
type ForgotPasswordFormData = z.infer<typeof forgotPasswordSchema>;
|
|
941
|
+
|
|
942
|
+
declare const magicLinkSchema: z.ZodObject<{
|
|
943
|
+
email: z.ZodString;
|
|
944
|
+
}, "strip", z.ZodTypeAny, {
|
|
945
|
+
email: string;
|
|
946
|
+
}, {
|
|
947
|
+
email: string;
|
|
948
|
+
}>;
|
|
949
|
+
type MagicLinkFormData = z.infer<typeof magicLinkSchema>;
|
|
950
|
+
|
|
951
|
+
declare const phoneNumberSchema: z.ZodObject<{
|
|
952
|
+
countryCode: z.ZodString;
|
|
953
|
+
phoneNumber: z.ZodString;
|
|
954
|
+
}, "strip", z.ZodTypeAny, {
|
|
955
|
+
countryCode: string;
|
|
956
|
+
phoneNumber: string;
|
|
957
|
+
}, {
|
|
958
|
+
countryCode: string;
|
|
959
|
+
phoneNumber: string;
|
|
960
|
+
}>;
|
|
961
|
+
type PhoneNumberFormData = z.infer<typeof phoneNumberSchema>;
|
|
962
|
+
declare const otpVerifySchema: z.ZodObject<{
|
|
963
|
+
code: z.ZodString;
|
|
964
|
+
}, "strip", z.ZodTypeAny, {
|
|
965
|
+
code: string;
|
|
966
|
+
}, {
|
|
967
|
+
code: string;
|
|
968
|
+
}>;
|
|
969
|
+
type OtpVerifyFormData = z.infer<typeof otpVerifySchema>;
|
|
970
|
+
declare const phonePasswordSchema: z.ZodObject<{
|
|
971
|
+
countryCode: z.ZodString;
|
|
972
|
+
phoneNumber: z.ZodString;
|
|
973
|
+
password: z.ZodString;
|
|
974
|
+
}, "strip", z.ZodTypeAny, {
|
|
975
|
+
password: string;
|
|
976
|
+
countryCode: string;
|
|
977
|
+
phoneNumber: string;
|
|
978
|
+
}, {
|
|
979
|
+
password: string;
|
|
980
|
+
countryCode: string;
|
|
981
|
+
phoneNumber: string;
|
|
982
|
+
}>;
|
|
983
|
+
type PhonePasswordFormData = z.infer<typeof phonePasswordSchema>;
|
|
984
|
+
|
|
985
|
+
declare const recoverEmailSchema: z.ZodObject<{
|
|
986
|
+
email: z.ZodString;
|
|
987
|
+
}, "strip", z.ZodTypeAny, {
|
|
988
|
+
email: string;
|
|
989
|
+
}, {
|
|
990
|
+
email: string;
|
|
991
|
+
}>;
|
|
992
|
+
type RecoverEmailFormData = z.infer<typeof recoverEmailSchema>;
|
|
993
|
+
declare const recoverCodeSchema: z.ZodObject<{
|
|
994
|
+
code: z.ZodString;
|
|
995
|
+
}, "strip", z.ZodTypeAny, {
|
|
996
|
+
code: string;
|
|
997
|
+
}, {
|
|
998
|
+
code: string;
|
|
999
|
+
}>;
|
|
1000
|
+
type RecoverCodeFormData = z.infer<typeof recoverCodeSchema>;
|
|
1001
|
+
declare const recoverNewPasswordSchema: z.ZodEffects<z.ZodObject<{
|
|
1002
|
+
newPassword: z.ZodString;
|
|
1003
|
+
confirmPassword: z.ZodString;
|
|
1004
|
+
}, "strip", z.ZodTypeAny, {
|
|
1005
|
+
newPassword: string;
|
|
1006
|
+
confirmPassword: string;
|
|
1007
|
+
}, {
|
|
1008
|
+
newPassword: string;
|
|
1009
|
+
confirmPassword: string;
|
|
1010
|
+
}>, {
|
|
1011
|
+
newPassword: string;
|
|
1012
|
+
confirmPassword: string;
|
|
1013
|
+
}, {
|
|
1014
|
+
newPassword: string;
|
|
1015
|
+
confirmPassword: string;
|
|
1016
|
+
}>;
|
|
1017
|
+
type RecoverNewPasswordFormData = z.infer<typeof recoverNewPasswordSchema>;
|
|
1018
|
+
declare const recoverPhoneSchema: z.ZodObject<{
|
|
1019
|
+
phoneNumber: z.ZodString;
|
|
1020
|
+
}, "strip", z.ZodTypeAny, {
|
|
1021
|
+
phoneNumber: string;
|
|
1022
|
+
}, {
|
|
1023
|
+
phoneNumber: string;
|
|
1024
|
+
}>;
|
|
1025
|
+
type RecoverPhoneFormData = z.infer<typeof recoverPhoneSchema>;
|
|
1026
|
+
type RecoveryMethod = "email_link" | "email_code" | "phone_otp";
|
|
1027
|
+
|
|
1028
|
+
declare const resetPasswordSchema: z.ZodEffects<z.ZodObject<{
|
|
1029
|
+
newPassword: z.ZodString;
|
|
1030
|
+
confirmPassword: z.ZodString;
|
|
1031
|
+
}, "strip", z.ZodTypeAny, {
|
|
1032
|
+
newPassword: string;
|
|
1033
|
+
confirmPassword: string;
|
|
1034
|
+
}, {
|
|
1035
|
+
newPassword: string;
|
|
1036
|
+
confirmPassword: string;
|
|
1037
|
+
}>, {
|
|
1038
|
+
newPassword: string;
|
|
1039
|
+
confirmPassword: string;
|
|
1040
|
+
}, {
|
|
1041
|
+
newPassword: string;
|
|
1042
|
+
confirmPassword: string;
|
|
1043
|
+
}>;
|
|
1044
|
+
type ResetPasswordFormData = z.infer<typeof resetPasswordSchema>;
|
|
1045
|
+
|
|
1046
|
+
declare const signupSchema: z.ZodObject<{
|
|
1047
|
+
email: z.ZodString;
|
|
1048
|
+
password: z.ZodString;
|
|
1049
|
+
name: z.ZodString;
|
|
1050
|
+
username: z.ZodOptional<z.ZodString>;
|
|
1051
|
+
phoneNumber: z.ZodOptional<z.ZodString>;
|
|
1052
|
+
organizationName: z.ZodOptional<z.ZodString>;
|
|
1053
|
+
acceptTerms: z.ZodBoolean;
|
|
1054
|
+
captchaToken: z.ZodOptional<z.ZodString>;
|
|
1055
|
+
}, "strip", z.ZodTypeAny, {
|
|
1056
|
+
email: string;
|
|
1057
|
+
name: string;
|
|
1058
|
+
password: string;
|
|
1059
|
+
acceptTerms: boolean;
|
|
1060
|
+
username?: string | undefined;
|
|
1061
|
+
captchaToken?: string | undefined;
|
|
1062
|
+
phoneNumber?: string | undefined;
|
|
1063
|
+
organizationName?: string | undefined;
|
|
1064
|
+
}, {
|
|
1065
|
+
email: string;
|
|
1066
|
+
name: string;
|
|
1067
|
+
password: string;
|
|
1068
|
+
acceptTerms: boolean;
|
|
1069
|
+
username?: string | undefined;
|
|
1070
|
+
captchaToken?: string | undefined;
|
|
1071
|
+
phoneNumber?: string | undefined;
|
|
1072
|
+
organizationName?: string | undefined;
|
|
1073
|
+
}>;
|
|
1074
|
+
type SignupFormData = z.infer<typeof signupSchema>;
|
|
1075
|
+
|
|
1076
|
+
declare const totpSchema: z.ZodObject<{
|
|
1077
|
+
code: z.ZodString;
|
|
1078
|
+
}, "strip", z.ZodTypeAny, {
|
|
1079
|
+
code: string;
|
|
1080
|
+
}, {
|
|
1081
|
+
code: string;
|
|
1082
|
+
}>;
|
|
1083
|
+
type TotpFormData = z.infer<typeof totpSchema>;
|
|
1084
|
+
declare const backupCodeSchema: z.ZodObject<{
|
|
1085
|
+
backupCode: z.ZodString;
|
|
1086
|
+
}, "strip", z.ZodTypeAny, {
|
|
1087
|
+
backupCode: string;
|
|
1088
|
+
}, {
|
|
1089
|
+
backupCode: string;
|
|
1090
|
+
}>;
|
|
1091
|
+
type BackupCodeFormData = z.infer<typeof backupCodeSchema>;
|
|
1092
|
+
|
|
1093
|
+
declare function getInitials(name: string): string;
|
|
1094
|
+
|
|
1095
|
+
type RiskLevel = "low" | "medium" | "high";
|
|
1096
|
+
declare function getRiskLevel(score: number): RiskLevel;
|
|
1097
|
+
declare const RISK_COLORS: Record<RiskLevel, string>;
|
|
1098
|
+
|
|
1099
|
+
/**
|
|
1100
|
+
* Safely converts an unknown caught value to AuthError.
|
|
1101
|
+
* If the value is already an AuthError, returns it directly.
|
|
1102
|
+
* Otherwise wraps the message in a new AuthError.
|
|
1103
|
+
*/
|
|
1104
|
+
declare function toAuthError(error: unknown): AuthError;
|
|
1105
|
+
|
|
1106
|
+
export { AUTH_ERROR_CODES, AccountSwitcher, type AccountSwitcherProps, AuthContext, type AuthContextValue, type AuthLocalization, AuthProvider, type AuthProviderProps, AuthView, type AuthViewPath, type AuthViewProps, type BackupCodeFormData, type CredentialLoginFormData, DeviceList, type DeviceListProps, EmailOTPForm, type EmailOTPFormProps, type EmailOtpCodeFormData, type EmailOtpEmailFormData, EmailVerificationForm, type EmailVerificationFormProps, ForgotPasswordForm, type ForgotPasswordFormData, type ForgotPasswordFormProps, 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, RecoverAccountForm, type RecoverAccountFormProps, type RecoverCodeFormData, type RecoverEmailFormData, type RecoverNewPasswordFormData, type RecoverPhoneFormData, type RecoveryMethod, ResetPasswordForm, type ResetPasswordFormData, type ResetPasswordFormProps, type RiskLevel, SessionGuard, type SessionGuardProps, SignupForm, type SignupFormData, type SignupFormProps, type TotpFormData, TwoFactorForm, type TwoFactorFormProps, UserMenu, type UserMenuProps, authLocalization, authViewPaths, backupCodeSchema, credentialLoginSchema, emailOtpCodeSchema, emailOtpEmailSchema, forgotPasswordSchema, getInitials, getLocalizedError, getRiskLevel, isEmail, magicLinkSchema, maskEmail, otpVerifySchema$1 as otpVerifySchema, phoneLoginSchema, phoneNumberSchema, otpVerifySchema as phoneOtpVerifySchema, phonePasswordSchema, recoverCodeSchema, recoverEmailSchema, recoverNewPasswordSchema, recoverPhoneSchema, resetPasswordSchema, signupSchema, toAuthError, totpSchema, useApiKeys, useAuth, useAuthContext, useAuthLocalization, useDevices, useLoginActivity, useOrganizations, usePhone, useSession, useSessions, useUser };
|