@seamless-auth/react 0.18.0 → 0.19.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/README.md +135 -1
- package/dist/AuthProvider.d.ts +10 -1
- package/dist/authRoutePaths.d.ts +8 -0
- package/dist/chunks/shared-GwBNo3wy.js +3 -0
- package/dist/chunks/shared-GwBNo3wy.js.map +1 -0
- package/dist/components/AccountSecurity.d.ts +7 -0
- package/dist/components/AuthenticatorAppSettings.d.ts +7 -0
- package/dist/components/PasskeyManagement.d.ts +7 -0
- package/dist/components/RecoveryCodeList.d.ts +13 -0
- package/dist/components/RecoveryCodeSettings.d.ts +8 -0
- package/dist/components/RecoveryRequests.d.ts +7 -0
- package/dist/components/TotpCodeForm.d.ts +12 -0
- package/dist/components/TotpEnrollment.d.ts +14 -0
- package/dist/components/TotpQrCode.d.ts +6 -0
- package/dist/hooks/useRecoveryOptions.d.ts +10 -0
- package/dist/hooks/useStepUpPrompt.d.ts +14 -0
- package/dist/index.d.ts +11 -4
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/routes.js +1 -1
- package/dist/routes.js.map +1 -1
- package/dist/views/AccountRecovery.d.ts +8 -0
- package/dist/views/AuthenticatorCodeLogin.d.ts +4 -0
- package/dist/views/AuthenticatorRegistration.d.ts +8 -0
- package/dist/views/RecoveryCancel.d.ts +8 -0
- package/dist/views/RecoveryCodeLogin.d.ts +7 -0
- package/dist/views/RecoveryCodes.d.ts +8 -0
- package/package.json +3 -3
- package/dist/chunks/shared-D9GCCBrm.js +0 -3
- package/dist/chunks/shared-D9GCCBrm.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,59 @@
|
|
|
1
1
|
# @seamless-auth/react
|
|
2
2
|
|
|
3
|
+
## 0.19.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 44854d0: The prebuilt UI covers account recovery from auth API v0.20.
|
|
8
|
+
- `AuthRoutes` serves `/recovery-code` (sign in with a recovery code), `/recovery-codes` (shown after a passkey is enrolled, to generate and save a first set, or a new one once every code is spent), `/account-recovery` (self-service recovery through a verified email or phone, with its waiting period) and `/recovery/cancel`, where the link in every recovery notice lands. That page takes the token from the URL fragment, drops it from the address bar and cancels the request. Mount `AuthRoutes` at the root of the deployment's `FRONTEND_URL` so the link resolves.
|
|
9
|
+
- The sign-in screen offers "Use a recovery code" and "Recover your account" only where `GET /system-config/public` reports `recoveryCodes` or `accountRecovery`. A recovery session goes straight to passkey enrollment, which it cannot skip.
|
|
10
|
+
- New router-free settings sections: `PasskeyManagement` (list with name, kind and last use, rename, delete, add another, and a nudge towards a second passkey), `RecoveryCodeSettings` (codes left, generate or replace with a step-up), `RecoveryRequests` (open recovery requests with cancel), and `AccountSecurity`, which renders all three.
|
|
11
|
+
- `useAuth()` adds `recoverySession`, `redeemRecoveryCode` and `completeAccountRecovery`, and the package re-exports `useRecoveryOptions`, `isStepUpRequired`, `isEnrollmentRequired`, `getRecoveryErrorCode` and the recovery types.
|
|
12
|
+
|
|
13
|
+
Needs an auth API with account recovery (v0.20) and a server adapter that proxies its manifest routes, including `POST /auth/refresh`.
|
|
14
|
+
|
|
15
|
+
- dbd4294: The prebuilt UI covers authenticator apps (TOTP).
|
|
16
|
+
- `AuthenticatorRegistration` at `/register-authenticator` sets up an authenticator app: a QR code of the `otpauth://` URL (drawn as an inline SVG, no new dependency), the setup key in groups of four with a copy button, an `otpauth://` link for a phone, and the first code. It then continues to `/recovery-codes` as passkey enrollment does.
|
|
17
|
+
- `/authenticator-code` signs in with a code from the app, on the sign-in `/login` started. The sign-in screen offers "Use an authenticator app" on every sign-in in progress, because `/login` never lists `totp` and the API answers the code step the same for an address with no account. Wrong or reused codes, lockouts, rate limits and passkey-only accounts each get their own message.
|
|
18
|
+
- A recovery session's passkey step offers "Use an authenticator app", which is the way forward on a device without passkeys. Verifying the first code lifts the recovery restriction, and the session is refreshed before the screen moves on.
|
|
19
|
+
- Replacing recovery codes, in `RecoveryCodeSettings` and on `/recovery-codes`, asks for a current code from the authenticator app when the API wants a step-up and the account has one, with the passkey as an alternative.
|
|
20
|
+
- New router-free settings section `AuthenticatorAppSettings` (status, inline enrollment, turn off with a current code), which `AccountSecurity` now renders between passkeys and recovery codes.
|
|
21
|
+
- The package re-exports `signInWithTotp`, `totpErrorMessage`, `formatTotpSecret`, `qrCode`, `TOTP_CODE_LENGTH` and the `QrCode` type for custom screens.
|
|
22
|
+
|
|
23
|
+
Needs an auth API with `POST /totp/verify-login` and a server adapter that proxies it.
|
|
24
|
+
|
|
25
|
+
### Patch Changes
|
|
26
|
+
|
|
27
|
+
- e5e6680: The bundled magic link and OAuth callback screens now remove the `token`, `code` and `state` from the address bar once they have read them, replacing the history entry, so the one-time values no longer stay in browser history or travel in a `Referer`. The Vue, Angular and Svelte screens already did this.
|
|
28
|
+
- dc52b23: Update `@seamless-auth/types` to 0.31.0, the contract for auth server v0.20.
|
|
29
|
+
- a5956b0: Update `@seamless-auth/types` to 0.33.0. `AccountRecoveryRequest`, `AccountRecoveryRequestsResult` and `RecoveryErrorCode` now alias the upstream shapes, and `RecoveryErrorCode` gains `enrollment_required`.
|
|
30
|
+
|
|
31
|
+
The recovery session flag is now read from the `recovery` field of `/users/me` as well, so `isRecoverySession()` and the session state's `recoverySession` survive a reload, a background revalidation and `initialSession`. A restored recovery session is sent to enrollment by the bundled sign-in screen, and the session is refreshed after a passkey or TOTP enrollment made from it.
|
|
32
|
+
|
|
33
|
+
- Updated dependencies [e5e6680]
|
|
34
|
+
- Updated dependencies [e5e6680]
|
|
35
|
+
- Updated dependencies [e5e6680]
|
|
36
|
+
- Updated dependencies [44854d0]
|
|
37
|
+
- Updated dependencies [e5e6680]
|
|
38
|
+
- Updated dependencies [8dbd3d8]
|
|
39
|
+
- Updated dependencies [8dbd3d8]
|
|
40
|
+
- Updated dependencies [8dbd3d8]
|
|
41
|
+
- Updated dependencies [dc52b23]
|
|
42
|
+
- Updated dependencies [a5956b0]
|
|
43
|
+
- @seamless-auth/client@0.8.0
|
|
44
|
+
|
|
45
|
+
## 0.18.1
|
|
46
|
+
|
|
47
|
+
### Patch Changes
|
|
48
|
+
|
|
49
|
+
- 15ed347: The SMS terms modal now lists `support@fellscode.com` as the opt-out and support contact.
|
|
50
|
+
- f21867d: OAuth sign-in now carries the state binding the auth server returns from `POST /oauth/:providerId/start` back to the callback. The session actions `startOAuthLogin` and `finishOAuthLogin` (and so `useAuth()` in React and React Native, and the Angular, Vue and Svelte bindings) store the binding with its state, attach it to the matching callback, and clear it afterwards, so apps that call these actions directly need no code change. The binding is kept in `sessionStorage` under `seamless:oauth:binding` in a browser and in memory elsewhere, and is never sent to the provider or put in a URL. `startOAuthSignIn` passes it explicitly when an in-app browser hands the callback back, and now refuses a callback whose state is not the one it started.
|
|
51
|
+
|
|
52
|
+
`StartOAuthLoginResult` gains an optional `binding` and `FinishOAuthLoginInput` an optional `binding`. Older auth servers return no binding and are unaffected. Auth API 0.19.x with fells-code/seamless-auth-api#463 refuses a callback without the binding, so upgrade this SDK before or with that API release.
|
|
53
|
+
|
|
54
|
+
- Updated dependencies [f21867d]
|
|
55
|
+
- @seamless-auth/client@0.7.1
|
|
56
|
+
|
|
3
57
|
## 0.18.0
|
|
4
58
|
|
|
5
59
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -25,6 +25,12 @@ New to Seamless Auth? The [self-hosted quickstart](https://docs.seamlessauth.com
|
|
|
25
25
|
- `getOAuthErrorCode()`, which reads the known OAuth callback failure codes off that error
|
|
26
26
|
- `getWebAuthnErrorDetail()`, which reads the underlying failure of a passkey or step-up ceremony
|
|
27
27
|
- `getPasskeyPolicyErrorCode()`, which reads the code the API refused a passkey registration with
|
|
28
|
+
- `isStepUpRequired()`, `isEnrollmentRequired()` and `getRecoveryErrorCode()` for the recovery routes
|
|
29
|
+
- `useRecoveryOptions()`, which reads whether the instance offers recovery codes and account recovery
|
|
30
|
+
- `signInWithTotp()`, `totpErrorMessage()`, `formatTotpSecret()`, `qrCode()` and `TOTP_CODE_LENGTH`
|
|
31
|
+
for custom authenticator app screens (see [TOTP](#totp-authenticator-apps))
|
|
32
|
+
- `AccountSecurity`, `PasskeyManagement`, `AuthenticatorAppSettings`, `RecoveryCodeSettings` and
|
|
33
|
+
`RecoveryRequests`, prebuilt account settings sections (see [Account recovery](#account-recovery))
|
|
28
34
|
- types including `AuthContextType`, `Credential`, `User`, `OAuthProvider`, `StepUpStatus`, the `SeamlessAuthResult` wrapper, and the headless client input/result types
|
|
29
35
|
|
|
30
36
|
## Installation
|
|
@@ -250,6 +256,9 @@ the session.
|
|
|
250
256
|
handlePasskeyLogin(): Promise<SeamlessAuthResult<PasskeyLoginData>>;
|
|
251
257
|
updateCredential(credential: Credential): Promise<SeamlessAuthResult<Credential>>;
|
|
252
258
|
deleteCredential(credentialId: string): Promise<SeamlessAuthResult<MessageResult>>;
|
|
259
|
+
recoverySession: boolean;
|
|
260
|
+
redeemRecoveryCode(code: string): Promise<SeamlessAuthResult<RecoverySessionResult>>;
|
|
261
|
+
completeAccountRecovery(): Promise<SeamlessAuthResult<RecoverySessionResult>>;
|
|
253
262
|
}
|
|
254
263
|
```
|
|
255
264
|
|
|
@@ -445,7 +454,26 @@ await authClient.disableTotp('123456');
|
|
|
445
454
|
|
|
446
455
|
These methods follow the standard result convention: check `error`, then read `data`. Enrolling TOTP is a sensitive change; gate it behind a fresh step-up when appropriate.
|
|
447
456
|
|
|
448
|
-
|
|
457
|
+
`qrCode(otpauthUrl)` returns `{ size, path }` for an SVG (`<svg viewBox="0 0 {size} {size}"><path d={path} /></svg>`, quiet zone included), and `formatTotpSecret(secret)` groups the secret in fours for manual entry. Keep the QR code on a light background in a dark theme so it still scans.
|
|
458
|
+
|
|
459
|
+
A user with an authenticator app can also sign in with it, on the sign-in `login()` started:
|
|
460
|
+
|
|
461
|
+
```ts
|
|
462
|
+
import { signInWithTotp } from '@seamless-auth/react';
|
|
463
|
+
|
|
464
|
+
await login(identifier, false);
|
|
465
|
+
const { error } = await signInWithTotp({ client: authClient, refreshSession }, '123456');
|
|
466
|
+
```
|
|
467
|
+
|
|
468
|
+
`/login` never lists `totp` in `loginMethods`, and the API answers `/totp/verify-login` the same for
|
|
469
|
+
an address with no account, so offering the option on every sign-in reveals nothing. A wrong code and
|
|
470
|
+
a reused one are both refused with `totp_verification_failed`; `totpErrorMessage(error)` turns that,
|
|
471
|
+
a lockout (`423`), a rate limit (`429`) and `login_method_disabled` (passkey-only accounts and
|
|
472
|
+
phishing-resistant policies) into copy.
|
|
473
|
+
|
|
474
|
+
The bundled screens cover all of this: `/register-authenticator` enrolls an app, `/authenticator-code`
|
|
475
|
+
signs in with one, and `AuthenticatorAppSettings` shows the status, enrolls inline and turns the app
|
|
476
|
+
off with a current code.
|
|
449
477
|
|
|
450
478
|
### WebAuthn PRF
|
|
451
479
|
|
|
@@ -574,6 +602,14 @@ function OAuthCallback() {
|
|
|
574
602
|
}
|
|
575
603
|
```
|
|
576
604
|
|
|
605
|
+
Auth servers that bind the OAuth state to the client that started sign-in (API 0.19.x with
|
|
606
|
+
fells-code/seamless-auth-api#463) return a `binding` from `startOAuthLogin` and refuse a callback
|
|
607
|
+
without it (`400`, `Invalid OAuth state`). The `useAuth()` actions handle this for you:
|
|
608
|
+
`startOAuthLogin` keeps the binding in `sessionStorage` under `seamless:oauth:binding`, keyed to its
|
|
609
|
+
`state`, and `finishOAuthLogin` sends it with the matching callback and then clears it. Only pass
|
|
610
|
+
`binding` yourself if you start and finish on different `useAuth()` instances or with the headless
|
|
611
|
+
client, and keep it out of URLs: it goes to your auth server, never to the provider.
|
|
612
|
+
|
|
577
613
|
Some callback failures are the user's to fix, so the API returns a stable `code` alongside the error
|
|
578
614
|
message. `getOAuthErrorCode()` narrows it to the codes this SDK knows about and returns `undefined`
|
|
579
615
|
for everything else, so unexpected failures keep your generic message:
|
|
@@ -1139,6 +1175,82 @@ const lastUsed = credential.lastUsedAt ? new Date(credential.lastUsedAt) : null;
|
|
|
1139
1175
|
Removing a passkey is a sensitive change. Gate it behind a fresh step-up when the account has other
|
|
1140
1176
|
factors, using `refreshStepUpStatus()` and `verifyStepUpWithPasskey()` from the step-up section.
|
|
1141
1177
|
|
|
1178
|
+
### Account recovery
|
|
1179
|
+
|
|
1180
|
+
Auth API v0.20 adds two ways back into an account that lost its passkeys, and the client exposes
|
|
1181
|
+
both. Every method returns a `SeamlessAuthResult`.
|
|
1182
|
+
|
|
1183
|
+
Recovery codes are single-use codes a signed-in user generates and saves:
|
|
1184
|
+
|
|
1185
|
+
```ts
|
|
1186
|
+
const client = useAuthClient();
|
|
1187
|
+
|
|
1188
|
+
await client.getRecoveryCodeStatus(); // { enabled, remaining, total, createdAt }
|
|
1189
|
+
const { data, error } = await client.generateRecoveryCodes(); // { codes, createdAt }, shown once
|
|
1190
|
+
```
|
|
1191
|
+
|
|
1192
|
+
Replacing an existing set needs a fresh step-up. Without one the call fails with a `403` that
|
|
1193
|
+
`isStepUpRequired(error)` recognizes. `generateRecoveryCodesWithStepUp({ client, verifyStepUp })`
|
|
1194
|
+
runs `verifyStepUp` (for example `useAuth().verifyStepUpWithPasskey`) and tries again.
|
|
1195
|
+
|
|
1196
|
+
Signing in with a code, or completing a self-service recovery, continues the sign-in `login()`
|
|
1197
|
+
started and issues a **recovery session**:
|
|
1198
|
+
|
|
1199
|
+
```ts
|
|
1200
|
+
const { login, redeemRecoveryCode, recoverySession } = useAuth();
|
|
1201
|
+
|
|
1202
|
+
await login(identifier, false);
|
|
1203
|
+
const { error } = await redeemRecoveryCode('ABCDE-FGHIJ');
|
|
1204
|
+
// recoverySession is now true
|
|
1205
|
+
```
|
|
1206
|
+
|
|
1207
|
+
A recovery session can only enroll a passkey or authenticator app, manage recovery codes, read the
|
|
1208
|
+
user and sign out; everything else answers `403` with `enrollment_required`
|
|
1209
|
+
(`isEnrollmentRequired(error)`), and the server adapter's `requireAuth` refuses it by default. Send
|
|
1210
|
+
the user to enrollment next. After `registerPasskey()` or `verifyTotpEnrollment()` succeeds from a
|
|
1211
|
+
recovery session the client calls `POST /auth/refresh`, so the new access token no longer carries
|
|
1212
|
+
the recovery claim, and `recoverySession` goes back to false on the next `refreshSession()`. The
|
|
1213
|
+
flag is read from `/users/me` as well, so a recovery session restored after a reload (or passed as
|
|
1214
|
+
`initialSession` with `recovery: true`) still goes to enrollment.
|
|
1215
|
+
|
|
1216
|
+
Self-service recovery is off unless the deployment turns it on. `useRecoveryOptions()` reports
|
|
1217
|
+
`recoveryCodes` and `accountRecovery` from the public configuration, so offer each only where it
|
|
1218
|
+
works:
|
|
1219
|
+
|
|
1220
|
+
```ts
|
|
1221
|
+
await client.startAccountRecovery('email'); // sends a six-digit code
|
|
1222
|
+
const { data } = await client.verifyAccountRecovery(code); // { state: 'pending', completesAt }
|
|
1223
|
+
await client.getAccountRecoveryStatus(); // 'ready' once completesAt has passed
|
|
1224
|
+
await completeAccountRecovery(); // from useAuth(): signs out every session, issues a recovery session
|
|
1225
|
+
```
|
|
1226
|
+
|
|
1227
|
+
The waiting period outlasts the pre-auth token, so a user returns later, signs in again, and starts
|
|
1228
|
+
on the **same channel**: verifying the new code resumes the open request. `getRecoveryErrorCode()`
|
|
1229
|
+
reads `account_recovery_disabled`, `recovery_notice_failed` (the owner could not be told, so nothing
|
|
1230
|
+
was opened), `recovery_not_ready`, `invalid_recovery_code` and the rest, and `recoveryErrorMessage()`
|
|
1231
|
+
turns them into copy.
|
|
1232
|
+
|
|
1233
|
+
Every notice links to `${FRONTEND_URL}/recovery/cancel#<token>`. `client.cancelAccountRecovery(token)`
|
|
1234
|
+
needs no session and answers the same whether or not the token matched. A signed-in owner can list
|
|
1235
|
+
and cancel open requests with `listAccountRecoveryRequests()` and `cancelAccountRecoveryRequest(id)`.
|
|
1236
|
+
|
|
1237
|
+
For settings screens the package ships router-free sections built on the same primitives:
|
|
1238
|
+
|
|
1239
|
+
```tsx
|
|
1240
|
+
import { AccountSecurity } from '@seamless-auth/react';
|
|
1241
|
+
|
|
1242
|
+
// Or individually: PasskeyManagement, AuthenticatorAppSettings, RecoveryCodeSettings, RecoveryRequests
|
|
1243
|
+
<AccountSecurity />;
|
|
1244
|
+
```
|
|
1245
|
+
|
|
1246
|
+
`PasskeyManagement` lists passkeys with their name, kind and last use, renames and deletes them, adds
|
|
1247
|
+
another, and encourages a second passkey when there is only one. `AuthenticatorAppSettings` shows
|
|
1248
|
+
whether an authenticator app is set up, enrolls one inline (QR code, setup key, first code) and turns
|
|
1249
|
+
it off with a current code. `RecoveryCodeSettings` shows how many codes are left and generates or
|
|
1250
|
+
replaces a set. When the API wants a step-up first it asks for a code from the authenticator app if
|
|
1251
|
+
one is set up (with the passkey as an alternative), and for the passkey otherwise.
|
|
1252
|
+
`RecoveryRequests` lists open recovery requests with a cancel button.
|
|
1253
|
+
|
|
1142
1254
|
## Built-In Routes
|
|
1143
1255
|
|
|
1144
1256
|
`AuthRoutes` serves these canonical paths:
|
|
@@ -1150,7 +1262,21 @@ factors, using `refreshStepUpStatus()` and `verifyStepUpWithPasskey()` from the
|
|
|
1150
1262
|
- `/verify-magic-link`
|
|
1151
1263
|
- `/oauth/callback`
|
|
1152
1264
|
- `/register-passkey`
|
|
1265
|
+
- `/register-authenticator`, set up an authenticator app: QR code, setup key with a copy button and an
|
|
1266
|
+
`otpauth://` link, then the first code. Continues to `/recovery-codes` like a passkey does
|
|
1153
1267
|
- `/magic-link-sent`
|
|
1268
|
+
- `/authenticator-code`, sign in with a code from an authenticator app
|
|
1269
|
+
- `/recovery-code`, sign in with a recovery code
|
|
1270
|
+
- `/recovery-codes`, shown after a passkey or authenticator app is enrolled: generates and shows a
|
|
1271
|
+
first set (or a new one when every code is spent), and continues once the user confirms they saved it
|
|
1272
|
+
- `/account-recovery`, self-service recovery: choose a channel, verify the code, wait, then finish
|
|
1273
|
+
- `/recovery/cancel`, where the link in a recovery notice lands
|
|
1274
|
+
|
|
1275
|
+
The sign-in screen offers "Use an authenticator app" beside the other methods on every sign-in in
|
|
1276
|
+
progress, and "Use a recovery code" and "Recover your account" only where the public configuration
|
|
1277
|
+
reports `recoveryCodes` or `accountRecovery`. A recovery session goes straight to `/register-passkey`,
|
|
1278
|
+
which then cannot be skipped but offers an authenticator app instead (the way forward on a device
|
|
1279
|
+
without passkeys).
|
|
1154
1280
|
|
|
1155
1281
|
These are optional UI wrappers over the same SDK primitives the package now exports for custom flows.
|
|
1156
1282
|
|
|
@@ -1174,6 +1300,9 @@ Two paths are unchanged because they are owned by contracts outside this package
|
|
|
1174
1300
|
discarded.
|
|
1175
1301
|
- `/oauth/callback` is registered with OAuth providers as an allowed redirect URI, so renaming it
|
|
1176
1302
|
would break configured integrations.
|
|
1303
|
+
- `/recovery/cancel` is the link the auth API puts in every account recovery notice. The page reads
|
|
1304
|
+
the token from the fragment, drops it from the address bar, then posts it. Mount `AuthRoutes` at the
|
|
1305
|
+
root of `FRONTEND_URL` so the link resolves.
|
|
1177
1306
|
|
|
1178
1307
|
## Theming The Built-In UI
|
|
1179
1308
|
|
|
@@ -1288,6 +1417,11 @@ The built-in flows assume compatible endpoints for:
|
|
|
1288
1417
|
- `/users/me`
|
|
1289
1418
|
- `/users/credentials`
|
|
1290
1419
|
- `/users/delete`
|
|
1420
|
+
- `POST /refresh` (after enrolling a factor from a recovery session)
|
|
1421
|
+
- `GET /recovery-codes`, `POST /recovery-codes` and `POST /recovery-codes/redeem`
|
|
1422
|
+
- `POST /recovery/start`, `POST /recovery/verify`, `GET /recovery/status`, `POST /recovery/complete`
|
|
1423
|
+
and `POST /recovery/cancel`
|
|
1424
|
+
- `GET /recovery/requests` and `DELETE /recovery/requests/:id`
|
|
1291
1425
|
- `/organizations`
|
|
1292
1426
|
- `/organizations/:organizationId`
|
|
1293
1427
|
- `/organizations/:organizationId/switch`
|
package/dist/AuthProvider.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CurrentUserResult, FinishOAuthLoginInput, FinishOAuthLoginResult, LoginStartResult, MessageResult, OAuthProvidersResult, OrganizationSwitchResult, PasskeyLoginData, PasskeyMetadata, PasskeyRegistrationData, RegisterPasskeyOptions, StartOAuthLoginInput, StartOAuthLoginResult, StepUpPrfData, StepUpStatus } from '@seamless-auth/client';
|
|
1
|
+
import { CurrentUserResult, FinishOAuthLoginInput, FinishOAuthLoginResult, LoginStartResult, MessageResult, OAuthProvidersResult, OrganizationSwitchResult, PasskeyLoginData, PasskeyMetadata, PasskeyRegistrationData, RecoverySessionResult, RegisterPasskeyOptions, StartOAuthLoginInput, StartOAuthLoginResult, StepUpPrfData, StepUpStatus } from '@seamless-auth/client';
|
|
2
2
|
import type { SeamlessAuthResult } from '@seamless-auth/client';
|
|
3
3
|
import { PasskeyPrfInput } from '@seamless-auth/client';
|
|
4
4
|
import { type InitialSession, type RefreshSessionOptions, type OAuthRedirectPort, type PasskeyPort, type SeamlessAuthClient, type TransportOptions } from '@seamless-auth/client';
|
|
@@ -29,6 +29,15 @@ export interface AuthContextType {
|
|
|
29
29
|
deleteCredential: (credentialId: string) => Promise<SeamlessAuthResult<MessageResult>>;
|
|
30
30
|
login: (identifier: string, passkeyAvailable: boolean) => Promise<SeamlessAuthResult<LoginStartResult>>;
|
|
31
31
|
handlePasskeyLogin: () => Promise<SeamlessAuthResult<PasskeyLoginData>>;
|
|
32
|
+
/**
|
|
33
|
+
* True while the session is a recovery session, which can only enroll a passkey
|
|
34
|
+
* or authenticator app. Enrolling one through `registerPasskey` lifts it.
|
|
35
|
+
*/
|
|
36
|
+
recoverySession: boolean;
|
|
37
|
+
/** Signs in with a recovery code, on the sign-in `login` started. */
|
|
38
|
+
redeemRecoveryCode: (code: string) => Promise<SeamlessAuthResult<RecoverySessionResult>>;
|
|
39
|
+
/** Completes an account recovery whose waiting period has passed. */
|
|
40
|
+
completeAccountRecovery: () => Promise<SeamlessAuthResult<RecoverySessionResult>>;
|
|
32
41
|
registerPasskey: (input: PasskeyMetadata | RegisterPasskeyOptions) => Promise<SeamlessAuthResult<PasskeyRegistrationData>>;
|
|
33
42
|
refreshStepUpStatus: () => Promise<SeamlessAuthResult<StepUpStatus>>;
|
|
34
43
|
verifyStepUpWithPasskey: () => Promise<SeamlessAuthResult<StepUpStatus>>;
|
package/dist/authRoutePaths.d.ts
CHANGED
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
* link, so it has to match that value exactly.
|
|
9
9
|
* - `oauthCallback` is registered with OAuth providers as an allowed redirect
|
|
10
10
|
* URI, so renaming it would break configured integrations.
|
|
11
|
+
* - `recoveryCancel` is the link the auth API puts in every account recovery
|
|
12
|
+
* notice (`${FRONTEND_URL}/recovery/cancel#<token>`).
|
|
11
13
|
*/
|
|
12
14
|
export declare const authRoutePaths: {
|
|
13
15
|
readonly login: "/login";
|
|
@@ -17,5 +19,11 @@ export declare const authRoutePaths: {
|
|
|
17
19
|
readonly verifyMagicLink: "/verify-magiclink";
|
|
18
20
|
readonly oauthCallback: "/oauth/callback";
|
|
19
21
|
readonly registerPasskey: "/register-passkey";
|
|
22
|
+
readonly registerAuthenticator: "/register-authenticator";
|
|
20
23
|
readonly magicLinkSent: "/magic-link-sent";
|
|
24
|
+
readonly recoveryCode: "/recovery-code";
|
|
25
|
+
readonly authenticatorCode: "/authenticator-code";
|
|
26
|
+
readonly recoveryCodes: "/recovery-codes";
|
|
27
|
+
readonly accountRecovery: "/account-recovery";
|
|
28
|
+
readonly recoveryCancel: "/recovery/cancel";
|
|
21
29
|
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import{jsx as e,jsxs as r,Fragment as t}from"react/jsx-runtime";import{createBrowserOAuthRedirect as o,createBrowserPasskeyPort as a,createAuthSession as n,isOtpCharacter as s,otpCharacters as c,TOTP_CODE_LENGTH as i,qrCode as l,totpErrorMessage as d,formatTotpSecret as u,detectPasskeySupport as m,recoveryCodesText as _,SeamlessAuthError as p,loadLoginMethods as h,loadRecoveryOptions as y}from"@seamless-auth/client";import{createContext as b,useContext as f,useMemo as v,useRef as g,useSyncExternalStore as k,useEffect as x,useState as w,useCallback as C}from"react";const N=b(void 0),S=()=>{const e=f(N);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e},M=({children:r,apiHost:t,autoDetectPreviousSignin:s=!0,magicLinkRedirectUri:c,transport:i,ports:l,initialSession:d})=>{const u=v(()=>({passkeys:l?.passkeys??a(),oauthRedirect:l?.oauthRedirect??o()}),[l?.passkeys,l?.oauthRedirect]);if("bearer"===i?.mode)throw new TypeError("@seamless-auth/react is cookie transport only, so the browser never holds the tokens. Use @seamless-auth/react-native for bearer transport in a native app.");const{basePath:m,fetch:_,trustedOrigins:p}=i??{},h=p?JSON.stringify(p):void 0,y=v(()=>i?{mode:"cookie",basePath:m,fetch:_,trustedOrigins:h?JSON.parse(h):void 0}:void 0,[m,_,h]),b=g(d),f=v(()=>n({apiHost:t,magicLinkRedirectUri:c,transport:y,passkeys:u.passkeys,detectPreviousSignIn:s,initialSession:b.current}),[t,c,y,u.passkeys,s]),w=k(f.subscribe,f.getState,f.getServerState);x(()=>{f.actions.refreshSession({background:void 0!==b.current})},[f]);const C=v(()=>({...w,...f.actions,apiHost:t,magicLinkRedirectUri:c,client:f.client,ports:u}),[w,f,t,c,u]);return e(N.Provider,{value:C,children:r})};function z(e,r){void 0===r&&(r={});var t=r.insertAt;if(e&&"undefined"!=typeof document){var o=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css","top"===t&&o.firstChild?o.insertBefore(a,o.firstChild):o.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}}var U="otpInput-module__otpContainer___MUjby",R="otpInput-module__otpInput___3YMVm";z(".otpInput-module__otpContainer___MUjby{display:flex;gap:8px;justify-content:center;margin-top:8px}.otpInput-module__otpInput___3YMVm{background:var(--seamless-surface-raised,#374151);border:1px solid var(--seamless-border,#4b5563);border-radius:8px;color:var(--seamless-text,#fff);font-size:1.2rem;height:48px;text-align:center;transition:border-color .15s ease,box-shadow .15s ease;width:42px}.otpInput-module__otpInput___3YMVm:focus{border-color:var(--seamless-accent,#60a5fa);box-shadow:0 0 0 2px var(--seamless-accent,rgba(96,165,250,.25));outline:none}");const j=({length:r=6,value:t,inputMode:o="numeric",onChange:a,name:n="otp"})=>{const i=g([]),l=t.split("").concat(Array(r).fill("")).slice(0,r),d=(e,t)=>{const n=c(t,o).slice(0,r),s=[...l];n.forEach((t,o)=>{e+o<r&&(s[e+o]=t)}),a(s.join("")),i.current[Math.min(e+n.length,r-1)]?.focus()};return e("div",{className:U,role:"group","aria-label":"One-time password input",onPaste:e=>{e.preventDefault(),d(0,e.clipboardData.getData("text"))},children:l.map((t,c)=>e("input",{ref:e=>i.current[c]=e,type:"text",inputMode:"numeric"===o?"numeric":"text",autoComplete:"one-time-code",name:`${n}-${c}`,maxLength:1,value:t,className:R,onChange:e=>((e,r)=>{if(r.length>1)d(e,r);else if(!r||s(r,o)){const t=[...l];t[e]=r;const o=t.join("");a(o),r&&i.current[e+1]&&i.current[e+1]?.focus()}})(c,e.target.value),onKeyDown:e=>((e,t)=>{if("Backspace"===t.key){t.preventDefault();const r=[...l];l[e]?(r[e]="",a(r.join(""))):e>0&&(r[e-1]="",a(r.join("")),i.current[e-1]?.focus())}"ArrowLeft"===t.key&&e>0&&i.current[e-1]?.focus(),"ArrowRight"===t.key&&e<r-1&&i.current[e+1]?.focus()})(c,e),"aria-label":`Digit ${c+1}`},c))})};var E={container:"recovery-module__container___QvUlz",card:"recovery-module__card___DENVH",title:"recovery-module__title___YldoC",description:"recovery-module__description___V6XuC",form:"recovery-module__form___E5BG6",label:"recovery-module__label___94Ob1",input:"recovery-module__input___aZC2k",button:"recovery-module__button___H8Tvz",secondary:"recovery-module__secondary___Uk6xk",link:"recovery-module__link___QwMHd",choices:"recovery-module__choices___yVsxl",error:"recovery-module__error___aknVn",success:"recovery-module__success___AjjM2",codes:"recovery-module__codes___p6dPw",actions:"recovery-module__actions___JaBq6",confirm:"recovery-module__confirm___JO6f6",loading:"recovery-module__loading___fJV2j"};z(".recovery-module__container___QvUlz{align-items:center;color:var(--seamless-text,#fff);display:flex;justify-content:center;padding:1rem}.recovery-module__card___DENVH{background-color:var(--seamless-surface,#1f2937);border-radius:.5rem;box-shadow:0 4px 6px var(--seamless-shadow,rgba(0,0,0,.1));max-width:28rem;padding:2rem;width:100%}.recovery-module__title___YldoC{font-size:1.5rem;font-weight:700;margin-bottom:1rem;text-align:center}.recovery-module__description___V6XuC{color:var(--seamless-text-muted,#d1d5db);margin-bottom:1rem}.recovery-module__form___E5BG6{display:flex;flex-direction:column;gap:1rem}.recovery-module__label___94Ob1{color:var(--seamless-text-muted,#d1d5db);display:block}.recovery-module__input___aZC2k{background-color:var(--seamless-surface-raised,#4b5563);border:1px solid var(--seamless-border,#d1d5db);border-radius:.375rem;color:inherit;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:.05em;margin-top:.25rem;padding:.5rem;width:100%}.recovery-module__input___aZC2k:focus{box-shadow:0 0 0 2px var(--seamless-accent,#3b82f6);outline:none}.recovery-module__button___H8Tvz{background-color:var(--seamless-accent,#3b82f6);border:none;border-radius:.5rem;color:var(--seamless-accent-contrast,#fff);cursor:pointer;font-weight:500;padding:.75rem 1rem;width:100%}.recovery-module__button___H8Tvz:hover:not(:disabled){background-color:var(--seamless-accent-hover,#2563eb)}.recovery-module__button___H8Tvz:disabled{cursor:default;opacity:.6}.recovery-module__secondary___Uk6xk{background:none;border:1px solid var(--seamless-accent,#3b82f6);border-radius:.5rem;color:var(--seamless-accent,#3b82f6);cursor:pointer;font-weight:500;padding:.75rem 1rem;width:100%}.recovery-module__secondary___Uk6xk:disabled{cursor:default;opacity:.6}.recovery-module__link___QwMHd{background:none;border:none;color:var(--seamless-accent-soft,#60a5fa);cursor:pointer;font-size:.875rem;text-align:center;width:100%}.recovery-module__choices___yVsxl{display:flex;flex-direction:column;gap:.75rem}.recovery-module__error___aknVn{color:var(--seamless-danger,#f87171);font-size:.875rem}.recovery-module__success___AjjM2{color:var(--seamless-success,#6ee7b7);font-size:.875rem}.recovery-module__codes___p6dPw{background-color:var(--seamless-surface-raised,#374151);border-radius:.5rem;display:grid;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:1rem;gap:.5rem;grid-template-columns:repeat(2,minmax(0,1fr));list-style:none;margin:0 0 1rem;padding:1rem;text-align:center}.recovery-module__actions___JaBq6{display:flex;gap:.5rem;margin-bottom:1rem}.recovery-module__actions___JaBq6>button{flex:1}.recovery-module__confirm___JO6f6{align-items:flex-start;display:flex;font-size:.875rem;gap:.5rem;margin-bottom:1rem}.recovery-module__loading___fJV2j{color:var(--seamless-text-muted,#d1d5db);text-align:center}");var T="totp-module__qr___PgNS3",L="totp-module__setupKey___tdGsC",V="totp-module__appLink___W3GEb",P="totp-module__form___t4zpM",O="totp-module__prompt___Kq-iK";z(".totp-module__qr___PgNS3{border-radius:.25rem;display:block;height:12rem;margin:0 auto 1rem;width:12rem}.totp-module__setupKey___tdGsC{background-color:var(--seamless-surface-raised,#374151);border-radius:.5rem;display:block;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:1rem;letter-spacing:.05em;margin:.25rem 0 .5rem;padding:.75rem;text-align:center;word-break:break-all}.totp-module__appLink___W3GEb{color:var(--seamless-accent-soft,#60a5fa);display:block;font-size:.875rem;margin-bottom:1rem;text-align:center}.totp-module__form___t4zpM{display:flex;flex-direction:column;gap:1rem}.totp-module__prompt___Kq-iK{border:1px solid var(--seamless-border,#4b5563);border-radius:.5rem;display:flex;flex-direction:column;gap:.75rem;margin-top:1rem;padding:1rem}");const D=({submitLabel:t,busyLabel:o="Checking...",onSubmit:a,buttonClassName:n=E.button,children:s})=>{const[c,l]=w(""),[d,u]=w(""),[m,_]=w(!1);return r("form",{onSubmit:async e=>{e.preventDefault(),u(""),_(!0);const r=await a(c);_(!1),r&&(u(r),l(""))},className:P,children:[e(j,{length:i,value:c,onChange:l,name:"totp",inputMode:"numeric"}),d&&e("p",{role:"alert",className:E.error,children:d}),e("button",{type:"submit",className:n,disabled:m||c.length!==i,children:m?o:t}),s]})},H=({value:t})=>{const o=v(()=>{try{return l(t)}catch{return null}},[t]);return o?r("svg",{role:"img","aria-label":"QR code for your authenticator app",className:T,viewBox:`0 0 ${o.size} ${o.size}`,shapeRendering:"crispEdges",children:[e("rect",{width:o.size,height:o.size,fill:"#ffffff"}),e("path",{d:o.path,fill:"#000000"})]}):null},B=()=>S().client,I=({onEnrolled:o,buttonClassName:a,children:n})=>{const s=B(),{refreshSession:c}=S(),[i,l]=w(null),[m,_]=w(""),[p,h]=w(""),y=g(!1),b=C(async()=>{_("");const{data:e,error:r}=await s.startTotpEnrollment();r?_(d(r,"We could not start setting up your authenticator app.")):l(e)},[s]);x(()=>{y.current||(y.current=!0,b())},[b]);if(!i)return r("div",{className:P,children:[m?r(t,{children:[e("p",{role:"alert",className:E.error,children:m}),e("button",{type:"button",className:a??E.button,onClick:()=>{b()},children:"Try again"})]}):e("p",{role:"status",className:E.loading,children:"Preparing your setup key..."}),n]});const f=i.otpauthUrl.startsWith("otpauth://")?i.otpauthUrl:null;return r("div",{children:[e("p",{className:E.description,children:"Scan this QR code with your authenticator app, or enter the setup key by hand."}),f&&e(H,{value:f}),f&&e("a",{href:f,className:V,children:"Open in an authenticator app on this device"}),e("p",{className:E.label,children:"Setup key"}),e("code",{className:L,children:u(i.secret)}),e("div",{className:E.actions,children:e("button",{type:"button",className:E.secondary,onClick:async()=>{if(i)try{await navigator.clipboard.writeText(i.secret),h("Copied to the clipboard.")}catch{h("Copying is not available here. Type the key in instead.")}},children:"Copy key"})}),p&&e("p",{role:"status",className:E.success,children:p}),e("p",{className:E.description,children:"Then enter the 6-digit code the app shows."}),e(D,{submitLabel:"Verify code",busyLabel:"Verifying...",onSubmit:async e=>{const{error:r}=await s.verifyTotpEnrollment(e);return r?d(r,"We could not verify that code."):(await c(),o(),null)},buttonClassName:a,children:n})]})},A=()=>{const{ports:e}=S(),[r,t]=w(!1),[o,a]=w(!0);return x(()=>{let r=!0;return m(e.passkeys).then(e=>{r&&(t(e),a(!1))}),()=>{r=!1}},[e.passkeys]),{passkeySupported:r,loading:o}},J=({codes:t,onDone:o,doneLabel:a="Continue"})=>{const[n,s]=w(!1),[c,i]=w("");return r("div",{children:[e("p",{className:E.description,children:"Save these codes somewhere safe, such as a password manager. Each one signs you in once if you lose your passkeys. You will not see them again."}),e("ul",{className:E.codes,"aria-label":"Recovery codes",children:t.map(r=>e("li",{children:r},r))}),r("div",{className:E.actions,children:[e("button",{type:"button",className:E.secondary,onClick:async()=>{try{await navigator.clipboard.writeText(t.join("\n")),i("Copied to the clipboard.")}catch{i("Copying is not available here. Write the codes down instead.")}},children:"Copy"}),e("button",{type:"button",className:E.secondary,onClick:()=>{const e=URL.createObjectURL(new Blob([_(t)],{type:"text/plain"})),r=document.createElement("a");r.href=e,r.download="recovery-codes.txt",r.click(),URL.revokeObjectURL(e)},children:"Download"})]}),c&&e("p",{role:"status",className:E.success,children:c}),r("label",{className:E.confirm,children:[e("input",{type:"checkbox",checked:n,onChange:e=>s(e.target.checked)}),"I have saved these recovery codes"]}),e("button",{type:"button",className:E.button,disabled:!n,onClick:o,children:a})]})};function W(){const t=B(),{credentials:o,verifyStepUpWithPasskey:a,verifyStepUpWithTotp:n}=S(),[s,c]=w(!1),i=g(null),l=g(!1),u=C(async()=>{l.current=!1;const{data:e}=await t.getTotpStatus();return e?.enabled?(c(!0),new Promise(e=>{i.current=e})):a()},[t,a]),m=e=>{c(!1),i.current?.(e),i.current=null};return{verifyStepUp:u,prompt:s?r("div",{className:O,role:"group","aria-label":"Confirm it is you",children:[e("p",{className:E.description,children:"Confirm it is you. Enter the current code from your authenticator app."}),r(D,{submitLabel:"Confirm",onSubmit:async e=>{const r=await n(e);return r.error?d(r.error,"We could not verify that code."):(m(r),null)},children:[(o?.length??0)>0&&e("button",{type:"button",className:E.secondary,onClick:()=>{(async()=>{m(await a())})()},children:"Use your passkey instead"}),e("button",{type:"button",className:E.link,onClick:()=>{l.current=!0,m({data:null,error:new p("Step-up cancelled.",0)})},children:"Cancel"})]})]}):null,cancelled:()=>l.current}}const q=()=>{const e=B(),[r,t]=w(null),[o,a]=w(!0);return x(()=>{let r=!0;return h(e).then(e=>{r&&(e&&t(e),a(!1))}),()=>{r=!1}},[e]),{loginMethods:r,loading:o}},K=()=>{const e=B(),[r,t]=w({recoveryCodes:!1,accountRecovery:!1}),[o,a]=w(!0);return x(()=>{let r=!0;return y(e).then(e=>{r&&(t(e),a(!1))}),()=>{r=!1}},[e]),{...r,loading:o}};export{M as A,j as O,J as R,I as T,D as a,S as b,A as c,W as d,q as e,K as f,E as g,z as s,B as u};
|
|
3
|
+
//# sourceMappingURL=shared-GwBNo3wy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared-GwBNo3wy.js","sources":["../../src/AuthProvider.tsx","../../../../node_modules/style-inject/dist/style-inject.es.js","../../src/components/OtpInput.tsx","../../src/components/TotpCodeForm.tsx","../../src/components/TotpQrCode.tsx","../../src/hooks/useAuthClient.ts","../../src/components/TotpEnrollment.tsx","../../src/hooks/usePasskeySupport.ts","../../src/components/RecoveryCodeList.tsx","../../src/hooks/useStepUpPrompt.tsx","../../src/hooks/useLoginMethods.ts","../../src/hooks/useRecoveryOptions.ts"],"sourcesContent":[null,"function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n",null,null,null,null,null,null,null,null,null,null],"names":["AuthContext","createContext","undefined","useAuth","context","useContext","Error","AuthProvider","children","apiHost","autoDetectPreviousSignin","magicLinkRedirectUri","transport","ports","providedPorts","initialSession","useMemo","passkeys","createBrowserPasskeyPort","oauthRedirect","createBrowserOAuthRedirect","mode","TypeError","basePath","fetch","fetchImpl","trustedOrigins","trustedOriginsKey","JSON","stringify","stableTransport","parse","initialSessionRef","useRef","session","createAuthSession","detectPreviousSignIn","current","state","useSyncExternalStore","subscribe","getState","getServerState","useEffect","actions","refreshSession","background","value","client","_jsx","Provider","styleInject","css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","OtpInput","length","inputMode","onChange","name","inputs","values","split","concat","Array","fill","slice","handleBulkInput","index","input","chars","otpCharacters","newValueArr","forEach","char","i","join","Math","min","focus","className","styles","role","onPaste","e","preventDefault","clipboardData","getData","map","el","autoComplete","maxLength","isOtpCharacter","newValue","handleChange","target","onKeyDown","key","handleKeyDown","TotpCodeForm","submitLabel","busyLabel","onSubmit","buttonClassName","recoveryStyles","button","code","setCode","useState","error","setError","busy","setBusy","_jsxs","async","event","message","TOTP_CODE_LENGTH","disabled","TotpQrCode","qrCode","viewBox","size","shapeRendering","width","height","d","path","useAuthClient","TotpEnrollment","onEnrolled","authClient","enrollment","setEnrollment","copyMessage","setCopyMessage","started","start","useCallback","data","startError","startTotpEnrollment","totpErrorMessage","_Fragment","onClick","loading","appLink","otpauthUrl","startsWith","description","href","label","formatTotpSecret","secret","secondary","navigator","clipboard","writeText","success","verifyError","verifyTotpEnrollment","usePasskeySupport","passkeySupported","setPasskeySupported","setLoading","active","detectPasskeySupport","then","supported","RecoveryCodeList","codes","onDone","doneLabel","saved","setSaved","url","URL","createObjectURL","Blob","recoveryCodesText","link","download","click","revokeObjectURL","confirm","checked","useStepUpPrompt","credentials","verifyStepUpWithPasskey","verifyStepUpWithTotp","open","setOpen","settleRef","cancelledRef","verifyStepUp","getTotpStatus","enabled","Promise","resolve","settle","result","prompt","stepUpWithPasskey","SeamlessAuthError","cancelled","useLoginMethods","loginMethods","setLoginMethods","loadLoginMethods","methods","useRecoveryOptions","options","setOptions","recoveryCodes","accountRecovery","loadRecoveryOptions","next"],"mappings":";2jBAwHA,MAAMA,EAAcC,OAA2CC,GAMlDC,EAAU,KACrB,MAAMC,EAAUC,EAAWL,GAC3B,IAAKI,EACH,MAAM,IAAIE,MAAM,+CAElB,OAAOF,GAgCIG,EAA4C,EACvDC,WACAC,UACAC,4BAA2B,EAC3BC,uBACAC,YACAC,MAAOC,EACPC,qBAKA,MAAMF,EAAQG,EACZ,KAAA,CACEC,SAAUH,GAAeG,UAAYC,IACrCC,cAAeL,GAAeK,eAAiBC,MAEjD,CAACN,GAAeG,SAAUH,GAAeK,gBAM3C,GAA4D,WAAvDP,GAA8CS,KACjD,MAAM,IAAIC,UACR,+JAIJ,MAAMC,SAAEA,EAAUC,MAAOC,EAASC,eAAEA,GAAmBd,GAAa,CAAA,EAE9De,EAAoBD,EAAiBE,KAAKC,UAAUH,QAAkBxB,EACtE4B,EAAkBd,EACtB,IACEJ,EACI,CACES,KAAM,SACNE,WACAC,MAAOC,EACPC,eAAgBC,EACXC,KAAKG,MAAMJ,QACZzB,QAENA,EAEN,CAACqB,EAAUE,EAAWE,IAMlBK,EAAoBC,EAAOlB,GAE3BmB,EAAUlB,EACd,IACEmB,EAAkB,CAChB1B,UACAE,uBACAC,UAAWkB,EACXb,SAAUJ,EAAMI,SAChBmB,qBAAsB1B,EACtBK,eAAgBiB,EAAkBK,UAEtC,CACE5B,EACAE,EACAmB,EACAjB,EAAMI,SACNP,IAOE4B,EAAQC,EACZL,EAAQM,UACRN,EAAQO,SACRP,EAAQQ,gBAcVC,EAAU,KACHT,EAAQU,QAAQC,eAAe,CAClCC,gBAA0C5C,IAA9B8B,EAAkBK,WAE/B,CAACH,IAEJ,MAAMa,EAAQ/B,EACZ,KAAA,IACKsB,KACAJ,EAAQU,QACXnC,UACAE,uBACAqC,OAAQd,EAAQc,OAChBnC,UAEF,CAAC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A,EACpD+L,GAAanI,QAAU,GAAK,GAC5BnB,YACEW,KAAK,SACLgC,UAAWwB,EAAekD,UAC1BV,QAAS,KAjBO9B,WAAYqF,QAAaX,MAiBrBc,IAAmB9M,SAAA,6BAK3CyC,EAAA,SAAA,CAAQW,KAAK,SAASgC,UAAWwB,EAAe4E,KAAMpC,QApB7C,KACbiD,EAAaxK,SAAU,EACvB8K,EAAO,CAAE5D,KAAM,KAAM9B,MAAO,IAAI8F,EAAkB,qBAAsB,gCAuBtE,KAE2BC,UAAW,IAAMX,EAAaxK,QAC/D,CChFO,MAAMoL,EAAkB,KAC7B,MAAM1E,EAAaH,KACZ8E,EAAcC,GAAmBnG,EAA+B,OAChEqC,EAASmB,GAAcxD,GAAS,GAmBvC,OAjBA7E,EAAU,KACR,IAAIsI,GAAS,EAWb,OATK2C,EAAiB7E,GAAYoC,KAAK0C,IAChC5C,IAED4C,GACFF,EAAgBE,GAElB7C,GAAW,MAGN,KACLC,GAAS,IAEV,CAAClC,IAEG,CAAE2E,eAAc7D,YC5BZiE,EAAqB,KAChC,MAAM/E,EAAaH,KACZmF,EAASC,GAAcxG,EAA0B,CACtDyG,eAAe,EACfC,iBAAiB,KAEZrE,EAASmB,GAAcxD,GAAS,GAiBvC,OAfA7E,EAAU,KACR,IAAIsI,GAAS,EASb,OAPKkD,EAAoBpF,GAAYoC,KAAKiD,IACnCnD,IAEL+C,EAAWI,GACXpD,GAAW,MAGN,KACLC,GAAS,IAEV,CAAClC,IAEG,IAAKgF,EAASlE","x_google_ignoreList":[1]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* A signed-in account settings panel: passkeys, authenticator app, recovery codes
|
|
4
|
+
* and open recovery requests. Each section is also exported on its own.
|
|
5
|
+
*/
|
|
6
|
+
export declare const AccountSecurity: React.FC;
|
|
7
|
+
export default AccountSecurity;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Whether an authenticator app is set up, with a way to add one or turn it off.
|
|
4
|
+
* Turning it off takes a current code from the app, which is the API's proof.
|
|
5
|
+
*/
|
|
6
|
+
export declare const AuthenticatorAppSettings: React.FC;
|
|
7
|
+
export default AuthenticatorAppSettings;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* The signed-in user's passkeys: rename, delete, and add another. Reads
|
|
4
|
+
* `credentials` from the provider, so a change shows without a reload.
|
|
5
|
+
*/
|
|
6
|
+
export declare const PasskeyManagement: React.FC;
|
|
7
|
+
export default PasskeyManagement;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface RecoveryCodeListProps {
|
|
3
|
+
codes: string[];
|
|
4
|
+
/** Called once the user confirms they saved the codes. */
|
|
5
|
+
onDone: () => void;
|
|
6
|
+
doneLabel?: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* A freshly generated set, shown once. The server keeps only hashes, so the user
|
|
10
|
+
* has to confirm they saved the codes before moving on.
|
|
11
|
+
*/
|
|
12
|
+
declare const RecoveryCodeList: React.FC<RecoveryCodeListProps>;
|
|
13
|
+
export default RecoveryCodeList;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* How many recovery codes are left, and a way to generate a new set. Replacing a
|
|
4
|
+
* set asks the user to confirm it is them first (passkey or authenticator app),
|
|
5
|
+
* which the API requires.
|
|
6
|
+
*/
|
|
7
|
+
export declare const RecoveryCodeSettings: React.FC;
|
|
8
|
+
export default RecoveryCodeSettings;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
interface TotpCodeFormProps {
|
|
3
|
+
submitLabel: string;
|
|
4
|
+
busyLabel?: string;
|
|
5
|
+
/** Resolves to an error message to show, or null once the code was accepted. */
|
|
6
|
+
onSubmit: (code: string) => Promise<string | null>;
|
|
7
|
+
buttonClassName?: string;
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
/** A six-digit authenticator code entry. A refused code is cleared, since the next one the app shows is the one to try. */
|
|
11
|
+
declare const TotpCodeForm: React.FC<TotpCodeFormProps>;
|
|
12
|
+
export default TotpCodeForm;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
interface TotpEnrollmentProps {
|
|
3
|
+
/** Called once the first code is verified and the session has been refreshed. */
|
|
4
|
+
onEnrolled: () => void;
|
|
5
|
+
buttonClassName?: string;
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Starts an authenticator app enrollment, shows the QR code and setup key, and
|
|
10
|
+
* verifies the first code. Verifying lifts a recovery session's restriction,
|
|
11
|
+
* so the session is refreshed before `onEnrolled` runs.
|
|
12
|
+
*/
|
|
13
|
+
declare const TotpEnrollment: React.FC<TotpEnrollmentProps>;
|
|
14
|
+
export default TotpEnrollment;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which recovery paths this instance offers, read from its public configuration.
|
|
3
|
+
* Both stay false until the answer arrives, so a sign-in screen never offers a
|
|
4
|
+
* path the instance has turned off.
|
|
5
|
+
*/
|
|
6
|
+
export declare const useRecoveryOptions: () => {
|
|
7
|
+
loading: boolean;
|
|
8
|
+
recoveryCodes: boolean;
|
|
9
|
+
accountRecovery: boolean;
|
|
10
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type SeamlessAuthResult, type StepUpStatus } from '@seamless-auth/client';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* A `verifyStepUp` for flows such as `generateRecoveryCodesWithStepUp`. With an
|
|
5
|
+
* authenticator app enrolled it renders `prompt` and waits for a code (or the
|
|
6
|
+
* passkey, when there is one); otherwise it goes straight to the passkey.
|
|
7
|
+
* `cancelled()` reports whether the last step-up ended because the user
|
|
8
|
+
* dismissed the prompt, so the caller can stay quiet about it.
|
|
9
|
+
*/
|
|
10
|
+
export declare function useStepUpPrompt(): {
|
|
11
|
+
verifyStepUp: () => Promise<SeamlessAuthResult<StepUpStatus>>;
|
|
12
|
+
prompt: ReactNode;
|
|
13
|
+
cancelled: () => boolean;
|
|
14
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
import { AuthContextType, AuthPorts, AuthProvider, useAuth } from './AuthProvider';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { AccountSecurity } from './components/AccountSecurity';
|
|
3
|
+
import { AuthenticatorAppSettings } from './components/AuthenticatorAppSettings';
|
|
4
|
+
import { PasskeyManagement } from './components/PasskeyManagement';
|
|
5
|
+
import { RecoveryCodeSettings } from './components/RecoveryCodeSettings';
|
|
6
|
+
import { RecoveryRequests } from './components/RecoveryRequests';
|
|
7
|
+
import { AccountRecoveryChannel, AccountRecoveryRequest, AccountRecoveryRequestsResult, AccountRecoveryStartResult, AccountRecoveryState, AccountRecoveryStatusResult, createSeamlessAuthClient, CredentialUpdateResult, CreateOrganizationInput, CurrentUserResult, FinishOAuthLoginInput, FinishOAuthLoginResult, LoginInput, LoginMethod, LoginStartResult, MessageResult, OAuthProvider, OAuthProvidersResult, PublicSystemConfigResult, OrganizationMemberInput, OrganizationMemberUpdateInput, OrganizationMembersResult, OrganizationMembershipResult, OrganizationResult, OrganizationSwitchResult, OrganizationsResult, PasskeyLoginData, PasskeyAttachment, PasskeyMetadata, PasskeyRegistrationData, RecoveryCodesResult, RecoveryCodeStatus, RecoverySessionResult, RegisterInput, RegisterPasskeyOptions, SeamlessAuthClient, SeamlessAuthClientOptions, StartOAuthLoginInput, StartOAuthLoginResult, StepUpMethod, StepUpStatus, StepUpPrfData, TotpEnrollmentStartResult, TotpStatus, UpdateOrganizationInput } from '@seamless-auth/client';
|
|
8
|
+
import { getOAuthErrorCode, getPasskeyPolicyErrorCode, getRecoveryErrorCode, getWebAuthnErrorDetail, isEnrollmentRequired, isStepUpRequired, isUnauthenticated, OAuthErrorCode, PasskeyPolicyErrorCode, RecoveryErrorCode, SeamlessAuthError, UntrustedOriginError, UntrustedRedirectError, WebAuthnErrorDetail } from '@seamless-auth/client';
|
|
4
9
|
import type { SeamlessAuthResult } from '@seamless-auth/client';
|
|
5
10
|
import { encodePrfSalt, extractPasskeyPrfResult, isPasskeyPrfSupported, PasskeyPrfInput, PasskeyPrfResult } from '@seamless-auth/client';
|
|
6
11
|
import { useAuthClient } from './hooks/useAuthClient';
|
|
7
12
|
import { useAuthorizedFetch } from './hooks/useAuthorizedFetch';
|
|
8
13
|
import { hasNonPasskeyLoginMethod, useLoginMethods } from './hooks/useLoginMethods';
|
|
9
14
|
import { usePasskeySupport } from './hooks/usePasskeySupport';
|
|
15
|
+
import { useRecoveryOptions } from './hooks/useRecoveryOptions';
|
|
10
16
|
import { hasScopedRole, roleGrantsAccess } from '@seamless-auth/client';
|
|
17
|
+
import { formatTotpSecret, qrCode, type QrCode, signInWithTotp, TOTP_CODE_LENGTH, totpErrorMessage } from '@seamless-auth/client';
|
|
11
18
|
import { Credential, Organization, OrganizationMembership, User } from '@seamless-auth/client';
|
|
12
19
|
import type { InitialSession, OAuthRedirectOutcome, OAuthRedirectPort, PasskeyPort, StoredTokens, TokenStoragePort, RefreshSessionOptions, TransportOptions } from '@seamless-auth/client';
|
|
13
|
-
export { AuthProvider, createSeamlessAuthClient, encodePrfSalt, extractPasskeyPrfResult, getOAuthErrorCode, getPasskeyPolicyErrorCode, getWebAuthnErrorDetail, hasNonPasskeyLoginMethod, hasScopedRole, isPasskeyPrfSupported, isUnauthenticated, roleGrantsAccess, SeamlessAuthError, UntrustedOriginError, UntrustedRedirectError, useAuth, useAuthClient, useAuthorizedFetch, useLoginMethods, usePasskeySupport, };
|
|
14
|
-
export type { CredentialUpdateResult, AuthContextType, AuthPorts, Credential, CreateOrganizationInput, CurrentUserResult, FinishOAuthLoginInput, FinishOAuthLoginResult, InitialSession, LoginInput, LoginMethod, LoginStartResult, MessageResult, OAuthErrorCode, OAuthProvider, OAuthProvidersResult, OAuthRedirectOutcome, OAuthRedirectPort, Organization, OrganizationMemberInput, OrganizationMembership, OrganizationMemberUpdateInput, OrganizationMembersResult, OrganizationMembershipResult, OrganizationResult, OrganizationSwitchResult, OrganizationsResult, PasskeyLoginData, PasskeyAttachment, PasskeyMetadata, PasskeyPolicyErrorCode, PasskeyPort, PasskeyPrfInput, PasskeyPrfResult, PasskeyRegistrationData, PublicSystemConfigResult, RefreshSessionOptions, RegisterInput, RegisterPasskeyOptions, SeamlessAuthClient, SeamlessAuthClientOptions, SeamlessAuthResult, StartOAuthLoginInput, StartOAuthLoginResult, StepUpMethod, StepUpStatus, StepUpPrfData, StoredTokens, TokenStoragePort, TotpEnrollmentStartResult, TotpStatus, TransportOptions, UpdateOrganizationInput, User, WebAuthnErrorDetail, };
|
|
20
|
+
export { AccountSecurity, AuthenticatorAppSettings, AuthProvider, createSeamlessAuthClient, encodePrfSalt, extractPasskeyPrfResult, formatTotpSecret, getOAuthErrorCode, getPasskeyPolicyErrorCode, getRecoveryErrorCode, getWebAuthnErrorDetail, hasNonPasskeyLoginMethod, hasScopedRole, isEnrollmentRequired, isPasskeyPrfSupported, isStepUpRequired, isUnauthenticated, PasskeyManagement, qrCode, RecoveryCodeSettings, RecoveryRequests, roleGrantsAccess, SeamlessAuthError, signInWithTotp, TOTP_CODE_LENGTH, totpErrorMessage, UntrustedOriginError, UntrustedRedirectError, useAuth, useAuthClient, useAuthorizedFetch, useLoginMethods, usePasskeySupport, useRecoveryOptions, };
|
|
21
|
+
export type { AccountRecoveryChannel, AccountRecoveryRequest, AccountRecoveryRequestsResult, AccountRecoveryStartResult, AccountRecoveryState, AccountRecoveryStatusResult, CredentialUpdateResult, AuthContextType, AuthPorts, Credential, CreateOrganizationInput, CurrentUserResult, FinishOAuthLoginInput, FinishOAuthLoginResult, InitialSession, LoginInput, LoginMethod, LoginStartResult, MessageResult, OAuthErrorCode, OAuthProvider, OAuthProvidersResult, OAuthRedirectOutcome, OAuthRedirectPort, Organization, OrganizationMemberInput, OrganizationMembership, OrganizationMemberUpdateInput, OrganizationMembersResult, OrganizationMembershipResult, OrganizationResult, OrganizationSwitchResult, OrganizationsResult, PasskeyLoginData, PasskeyAttachment, PasskeyMetadata, PasskeyPolicyErrorCode, PasskeyPort, PasskeyPrfInput, PasskeyPrfResult, PasskeyRegistrationData, PublicSystemConfigResult, QrCode, RecoveryCodesResult, RecoveryCodeStatus, RecoveryErrorCode, RecoverySessionResult, RefreshSessionOptions, RegisterInput, RegisterPasskeyOptions, SeamlessAuthClient, SeamlessAuthClientOptions, SeamlessAuthResult, StartOAuthLoginInput, StartOAuthLoginResult, StepUpMethod, StepUpStatus, StepUpPrfData, StoredTokens, TokenStoragePort, TotpEnrollmentStartResult, TotpStatus, TransportOptions, UpdateOrganizationInput, User, WebAuthnErrorDetail, };
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import{u as e}from"./chunks/shared-D9GCCBrm.js";export{A as AuthProvider,a as useAuthClient,b as useLoginMethods,c as usePasskeySupport}from"./chunks/shared-D9GCCBrm.js";export{SeamlessAuthError,UntrustedOriginError,UntrustedRedirectError,createSeamlessAuthClient,encodePrfSalt,extractPasskeyPrfResult,getOAuthErrorCode,getPasskeyPolicyErrorCode,getWebAuthnErrorDetail,hasNonPasskeyLoginMethod,hasScopedRole,isPasskeyPrfSupported,isUnauthenticated,roleGrantsAccess}from"@seamless-auth/client";import"react";import"react/jsx-runtime";const r=()=>e().client.authorizedFetch;export{e as useAuth,r as useAuthorizedFetch};
|
|
2
|
+
import{s as a,u as t,T as r,a as s,b as o,c as n,d as c,R as l}from"./chunks/shared-GwBNo3wy.js";export{A as AuthProvider,e as useLoginMethods,f as useRecoveryOptions}from"./chunks/shared-GwBNo3wy.js";import{jsxs as i,jsx as d,Fragment as u}from"react/jsx-runtime";import{totpErrorMessage as m,passkeyDisplayName as _,PASSKEY_KIND_LABELS as p,passkeyKind as y,passkeyMetadataForThisDevice as h,passkeyRegistrationErrorMessage as b,recoveryErrorMessage as g,generateRecoveryCodesWithStepUp as v}from"@seamless-auth/client";export{SeamlessAuthError,TOTP_CODE_LENGTH,UntrustedOriginError,UntrustedRedirectError,createSeamlessAuthClient,encodePrfSalt,extractPasskeyPrfResult,formatTotpSecret,getOAuthErrorCode,getPasskeyPolicyErrorCode,getRecoveryErrorCode,getWebAuthnErrorDetail,hasNonPasskeyLoginMethod,hasScopedRole,isEnrollmentRequired,isPasskeyPrfSupported,isStepUpRequired,isUnauthenticated,qrCode,roleGrantsAccess,signInWithTotp,totpErrorMessage}from"@seamless-auth/client";import{useState as N,useCallback as S,useEffect as k}from"react";var C="accountSecurity-module__section___WD7WD",w="accountSecurity-module__heading___GikWB",x="accountSecurity-module__description___aUHsR",R="accountSecurity-module__notice___XKlo2",D="accountSecurity-module__warning___6-0vc",P="accountSecurity-module__list___A5K5L",q="accountSecurity-module__item___6j-XO",E="accountSecurity-module__itemName___eqMtZ",L="accountSecurity-module__meta___J3mVP",T="accountSecurity-module__itemActions___MQY-g",$="accountSecurity-module__input___sZcEB",U="accountSecurity-module__button___ea-6Z",W="accountSecurity-module__secondary___cAXbn",O="accountSecurity-module__danger___-i8vC",z="accountSecurity-module__error___AsI2f",M="accountSecurity-module__success___WPyJs";a(".accountSecurity-module__section___WD7WD{background-color:var(--seamless-surface,#1f2937);border-radius:.5rem;color:var(--seamless-text,#fff);margin-bottom:1rem;padding:1.5rem}.accountSecurity-module__heading___GikWB{font-size:1.125rem;font-weight:600;margin:0 0 .5rem}.accountSecurity-module__description___aUHsR{color:var(--seamless-text-muted,#d1d5db);font-size:.875rem;margin:0 0 1rem}.accountSecurity-module__notice___XKlo2{border-left:3px solid var(--seamless-accent,#3b82f6);font-size:.875rem;margin:0 0 1rem;padding:.5rem .75rem}.accountSecurity-module__warning___6-0vc{border-left:3px solid var(--seamless-danger,#f87171);font-size:.875rem;margin:0 0 1rem;padding:.5rem .75rem}.accountSecurity-module__list___A5K5L{display:flex;flex-direction:column;gap:.75rem;list-style:none;margin:0 0 1rem;padding:0}.accountSecurity-module__item___6j-XO{border:1px solid var(--seamless-border,#4b5563);border-radius:.5rem;display:flex;flex-wrap:wrap;gap:.75rem;justify-content:space-between;padding:.75rem}.accountSecurity-module__itemName___eqMtZ{font-weight:600}.accountSecurity-module__meta___J3mVP{color:var(--seamless-text-muted,#9ca3af);font-size:.8125rem;margin:.25rem 0 0}.accountSecurity-module__itemActions___MQY-g{align-items:center;display:flex;flex-wrap:wrap;gap:.5rem}.accountSecurity-module__input___sZcEB{background-color:var(--seamless-surface-raised,#4b5563);border:1px solid var(--seamless-border,#d1d5db);border-radius:.375rem;color:inherit;padding:.375rem .5rem}.accountSecurity-module__button___ea-6Z{background-color:var(--seamless-accent,#3b82f6);border:none;border-radius:.375rem;color:var(--seamless-accent-contrast,#fff);cursor:pointer;font-weight:500;padding:.5rem .875rem}.accountSecurity-module__button___ea-6Z:disabled,.accountSecurity-module__danger___-i8vC:disabled,.accountSecurity-module__secondary___cAXbn:disabled{cursor:default;opacity:.6}.accountSecurity-module__secondary___cAXbn{background:none;border:1px solid var(--seamless-accent,#3b82f6);border-radius:.375rem;color:var(--seamless-accent,#3b82f6);cursor:pointer;padding:.5rem .875rem}.accountSecurity-module__danger___-i8vC{background:none;border:1px solid var(--seamless-danger,#f87171);border-radius:.375rem;color:var(--seamless-danger,#f87171);cursor:pointer;padding:.5rem .875rem}.accountSecurity-module__error___AsI2f{color:var(--seamless-danger,#f87171);font-size:.875rem}.accountSecurity-module__success___WPyJs{color:var(--seamless-success,#6ee7b7);font-size:.875rem}");const X=e=>new Date(e).toLocaleDateString(),Z=()=>{const e=t(),[a,o]=N(null),[n,c]=N("view"),[l,_]=N(""),[p,y]=N(""),h=S(async()=>{const{data:a,error:t}=await e.getTotpStatus();t?_(m(t,"Could not load your authenticator app settings.")):(_(""),o(a))},[e]);k(()=>{h()},[h]);const b=e=>{y(""),c(e)};return i("section",{className:C,"aria-labelledby":"seamless-totp-heading",children:[d("h3",{id:"seamless-totp-heading",className:w,children:"Authenticator app"}),d("p",{className:x,children:"Six-digit codes from an app on your phone, for signing in and confirming it is you."}),"enroll"===n&&d(r,{onEnrolled:()=>{c("view"),y("Authenticator app added."),h()},buttonClassName:U,children:d("button",{type:"button",className:W,onClick:()=>b("view"),children:"Cancel"})}),"disable"===n&&i(u,{children:[d("p",{className:R,children:"Enter the current code from your authenticator app to turn it off."}),d(s,{submitLabel:"Turn off authenticator app",busyLabel:"Turning off...",onSubmit:async a=>{const{error:t}=await e.disableTotp(a);return t?m(t,"Could not turn off your authenticator app."):(c("view"),y("Authenticator app turned off."),h(),null)},buttonClassName:O,children:d("button",{type:"button",className:W,onClick:()=>b("view"),children:"Cancel"})})]}),"view"===n&&a&&i(u,{children:[d("p",{className:R,children:a.enabled?`Turned on${a.verifiedAt?` since ${X(a.verifiedAt)}`:""}. ${a.lastUsedAt?`Last used ${X(a.lastUsedAt)}.`:"Not used yet."}`:"No authenticator app is set up."}),a.enabled?d("button",{type:"button",className:O,onClick:()=>b("disable"),children:"Turn off"}):d("button",{type:"button",className:U,onClick:()=>b("enroll"),children:"Set up authenticator app"})]}),p&&d("p",{role:"status",className:M,children:p}),l&&d("p",{role:"alert",className:z,children:l})]})},j=e=>e?new Date(e).toLocaleDateString():null,G=({credential:e,onlyOne:a})=>{const{updateCredential:t,deleteCredential:r}=o(),[s,n]=N(!1),[c,l]=N(!1),[m,h]=N(_(e)),[b,g]=N(!1),[f,v]=N(""),S=_(e),k=j(e.lastUsedAt),C=j(e.createdAt);return i("li",{className:q,children:[i("div",{children:[s?i("form",{onSubmit:async a=>{a.preventDefault(),g(!0),v("");const r=m.trim(),{error:s}=await t({...e,friendlyName:""===r?null:r});g(!1),s?v("Could not rename this passkey. Please try again."):n(!1)},className:T,children:[i("label",{children:[d("span",{className:L,children:"Passkey name"}),d("input",{className:$,value:m,onChange:e=>h(e.target.value),maxLength:100,autoFocus:!0})]}),d("button",{type:"submit",className:U,disabled:b,children:"Save"}),d("button",{type:"button",className:W,onClick:()=>{n(!1),h(S)},children:"Cancel"})]}):d("span",{className:E,children:S}),i("p",{className:L,children:[p[y(e)],C?` · Added ${C}`:""," · "+(k?`Last used ${k}`:"Never used")]}),f&&d("p",{role:"alert",className:z,children:f})]}),!s&&d("div",{className:T,children:i(u,c?{children:[d("span",{className:L,children:a?"This is your only passkey. Delete it anyway?":"Delete this passkey?"}),d("button",{type:"button",className:O,onClick:()=>{(async()=>{g(!0),v("");const{error:a}=await r(e.id);g(!1),a&&(v("Could not delete this passkey. Please try again."),l(!1))})()},disabled:b,children:"Delete"}),d("button",{type:"button",className:W,onClick:()=>l(!1),children:"Keep"})]}:{children:[d("button",{type:"button",className:W,onClick:()=>n(!0),"aria-label":`Rename ${S}`,children:"Rename"}),d("button",{type:"button",className:O,onClick:()=>l(!0),"aria-label":`Delete ${S}`,children:"Delete"})]})})]})},Y=()=>{const{credentials:e,registerPasskey:a}=o(),{passkeySupported:t,loading:r}=n(),[s,c]=N(!1),[l,u]=N();return i("section",{className:C,"aria-labelledby":"seamless-passkeys-heading",children:[d("h3",{id:"seamless-passkeys-heading",className:w,children:"Passkeys"}),d("p",{className:x,children:"Passkeys sign you in with your device's screen lock or a security key."}),0===e.length&&d("p",{className:D,children:"You have no passkeys. Add one so you can sign in without a code."}),1===e.length&&d("p",{className:R,children:"You have one passkey. Add a second, on another device or a security key, so losing this one does not lock you out."}),e.length>0&&d("ul",{className:P,children:e.map(a=>d(G,{credential:a,onlyOne:1===e.length},a.id))}),d("button",{type:"button",className:U,onClick:()=>{(async()=>{c(!0),u(void 0);const{error:e}=await a({metadata:h()});c(!1),u(e?{kind:"error",text:b(e)}:{kind:"success",text:"Passkey added."})})()},disabled:s||!t,children:s?"Adding...":"Add a passkey"}),!r&&!t&&d("p",{className:L,children:"This browser cannot create passkeys."}),l&&d("p",{role:"error"===l.kind?"alert":"status",className:"error"===l.kind?z:M,children:l.text})]})},K=()=>{const e=t(),a=c(),[r,s]=N(null),[o,n]=N(null),[m,_]=N(""),[p,y]=N(!1),h=S(async()=>{const{data:a,error:t}=await e.getRecoveryCodeStatus();t?_(g(t,"Could not load your recovery codes.")):s(a)},[e]);k(()=>{h()},[h]);const b=(r?.total??0)>0;return i("section",{className:C,"aria-labelledby":"seamless-recovery-codes-heading",children:[d("h3",{id:"seamless-recovery-codes-heading",className:w,children:"Recovery codes"}),d("p",{className:x,children:"Single-use codes that sign you in if you lose your passkeys."}),o?d(l,{codes:o,onDone:()=>{n(null),h()},doneLabel:"Done"}):i(u,{children:[r&&!r.enabled&&d("p",{className:R,children:"Recovery codes are turned off for this application."}),r?.enabled&&i(u,{children:[d("p",{className:b&&r.remaining<=2?D:R,children:b?`${r.remaining} of ${r.total} codes left${r.createdAt?`, created ${new Date(r.createdAt).toLocaleDateString()}`:""}.`:"You have no recovery codes yet."}),d("button",{type:"button",className:U,onClick:()=>{(async()=>{y(!0),_("");const t=await v({client:e,verifyStepUp:a.verifyStepUp});y(!1),"error"!==t.kind?n(t.codes.codes):a.cancelled()||_(t.message)})()},disabled:p,children:p?"Generating...":b?"Replace recovery codes":"Generate recovery codes"}),b&&d("p",{className:L,children:"Replacing your codes stops the old ones working. You will be asked to confirm it is you first."}),a.prompt]})]}),m&&d("p",{role:"alert",className:z,children:m})]})},B={email:"email",phone:"text message"},I=e=>new Date(e).toLocaleString(),J=()=>{const e=t(),[a,r]=N(null),[s,o]=N(""),[n,c]=N(null);k(()=>{let a=!0;return e.listAccountRecoveryRequests().then(({data:e,error:t})=>{a&&(t?o(g(t,"Could not load recovery requests.")):r(e.requests))}),()=>{a=!1}},[e]);return i("section",{className:C,"aria-labelledby":"seamless-recovery-requests-heading",children:[d("h3",{id:"seamless-recovery-requests-heading",className:w,children:"Account recovery requests"}),0===a?.length&&d("p",{className:x,children:"No one is trying to recover this account."}),a&&a.length>0&&i(u,{children:[d("p",{className:D,children:"Someone asked to recover this account. If it was not you, cancel the request."}),d("ul",{className:P,children:a.map(a=>i("li",{className:q,children:[i("div",{children:[i("span",{className:E,children:["Recovery by ",B[a.channel]]}),i("p",{className:L,children:["Requested ",I(a.requestedAt),"ready"===a.state?" · Can be completed now":` · Completes ${I(a.completesAt)}`]})]}),d("div",{className:T,children:d("button",{type:"button",className:O,onClick:()=>{(async a=>{c(a),o("");const{error:t}=await e.cancelAccountRecoveryRequest(a);c(null),t?o(g(t,"Could not cancel the recovery request.")):r(e=>e?.filter(e=>e.id!==a)??null)})(a.id)},disabled:n===a.id,children:n===a.id?"Cancelling...":"Cancel request"})})]},a.id))})]}),s&&d("p",{role:"alert",className:z,children:s})]})},H=()=>i("div",{children:[d(Y,{}),d(Z,{}),d(K,{}),d(J,{})]}),F=()=>o().client.authorizedFetch;export{H as AccountSecurity,Z as AuthenticatorAppSettings,Y as PasskeyManagement,K as RecoveryCodeSettings,J as RecoveryRequests,o as useAuth,t as useAuthClient,F as useAuthorizedFetch,n as usePasskeySupport};
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/hooks/useAuthorizedFetch.ts"],"sourcesContent":[null],"names":["
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/components/AuthenticatorAppSettings.tsx","../src/components/PasskeyManagement.tsx","../src/components/RecoveryCodeSettings.tsx","../src/components/RecoveryRequests.tsx","../src/components/AccountSecurity.tsx","../src/hooks/useAuthorizedFetch.ts"],"sourcesContent":[null,null,null,null,null,null],"names":["formatDate","value","Date","toLocaleDateString","AuthenticatorAppSettings","authClient","useAuthClient","status","setStatus","useState","mode","setMode","error","setError","notice","setNotice","load","useCallback","async","data","statusError","getTotpStatus","totpErrorMessage","useEffect","show","next","_jsxs","className","styles","_jsx","id","children","TotpEnrollment","onEnrolled","buttonClassName","type","onClick","_Fragment","TotpCodeForm","submitLabel","busyLabel","onSubmit","code","disableError","disableTotp","enabled","verifiedAt","lastUsedAt","role","PasskeyRow","credential","onlyOne","updateCredential","deleteCredential","useAuth","renaming","setRenaming","confirmingDelete","setConfirmingDelete","name","setName","passkeyDisplayName","busy","setBusy","displayName","lastUsed","added","createdAt","event","preventDefault","trimmed","trim","renameError","friendlyName","onChange","target","maxLength","autoFocus","disabled","PASSKEY_KIND_LABELS","passkeyKind","deleteError","remove","PasskeyManagement","credentials","registerPasskey","passkeySupported","loading","supportLoading","usePasskeySupport","adding","setAdding","message","setMessage","length","map","undefined","metadata","passkeyMetadataForThisDevice","kind","text","passkeyRegistrationErrorMessage","add","RecoveryCodeSettings","stepUp","useStepUpPrompt","codes","setCodes","getRecoveryCodeStatus","recoveryErrorMessage","hasSet","total","RecoveryCodeList","onDone","doneLabel","remaining","outcome","generateRecoveryCodesWithStepUp","client","verifyStepUp","cancelled","generate","prompt","CHANNEL_LABELS","email","phone","formatTime","toLocaleString","RecoveryRequests","requests","setRequests","cancelling","setCancelling","active","listAccountRecoveryRequests","then","listError","request","channel","requestedAt","state","completesAt","cancelError","cancelAccountRecoveryRequest","current","filter","cancel","AccountSecurity","useAuthorizedFetch","authorizedFetch"],"mappings":";0nIAgBA,MAAMA,EAAcC,GAAkB,IAAIC,KAAKD,GAAOE,qBAMzCC,EAAqC,KAChD,MAAMC,EAAaC,KACZC,EAAQC,GAAaC,EAA4B,OACjDC,EAAMC,GAAWF,EAAe,SAChCG,EAAOC,GAAYJ,EAAS,KAC5BK,EAAQC,GAAaN,EAAS,IAE/BO,EAAOC,EAAYC,UACvB,MAAMC,KAAEA,EAAMP,MAAOQ,SAAsBf,EAAWgB,gBAElDD,EACFP,EACES,EAAiBF,EAAa,qDAKlCP,EAAS,IACTL,EAAUW,KACT,CAACd,IAEJkB,EAAU,KACHP,KACJ,CAACA,IAEJ,MAAMQ,EAAQC,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CpCoH,CAAOT,EAAQ3G,KACnCgD,SAAUqD,IAAeM,EAAQ3G,GAAEC,SAElCoG,IAAeM,EAAQ3G,GAAK,gBAAkB,uBAnB5C2G,EAAQ3G,UA4BxBlB,GACCiB,EAAA,IAAA,CAAGmB,KAAK,QAAQrB,UAAWC,EAAYG,SACpCnB,QCnGEuI,EAA4B,IACvCzH,EAAA,MAAA,CAAAK,SAAA,CACEF,EAACsD,EAAiB,CAAA,GAClBtD,EAACzB,EAAwB,IACzByB,EAAC0E,EAAoB,CAAA,GACrB1E,EAACmG,EAAgB,OCTRoB,EAAqB,IAAM9F,IAAUgE,OAAO+B"}
|
package/dist/routes.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import{jsxs as e,jsx as r,Fragment as o}from"react/jsx-runtime";import{useHref as i,useNavigate as n,useLocation as a,useSearchParams as s,Routes as t,Route as l,Navigate as c}from"react-router-dom";import{u as d,a as _,c as m,b as u}from"./chunks/shared-D9GCCBrm.js";import{useState as g,useEffect as f,useRef as p}from"react";import{fallbackSignInOptions as h,hasFallbackSignInOption as v,OAUTH_CALLBACK_PATH as b,startOAuthSignIn as y,isValidEmail as k,isValidPhoneNumber as x,beginSignIn as w,PASSKEY_SIGN_IN_FAILED as N,registerWithEmail as P,safeReturnPath as M,hasNonPasskeyLoginMethod as T,enrollPasskey as C,isOtpCharacter as O,otpCharacters as B,OTP_LIFETIME_SECONDS as I,formatCountdown as S,OTP_LENGTH as z,verifyOtp as L,requestOtp as q,otpResendFailedMessage as A,magicLinkConfirmationPrompt as D,getMagicLinkConfirmation as R,finishMagicLinkSignIn as E,confirmMagicLinkSignIn as j,completeOAuthCallback as F,MAGIC_LINK_RESEND_COOLDOWN_SECONDS as G,watchMagicLink as V}from"@seamless-auth/client";const U="/login",K="/passkey-login",Y="/verify-phone-otp",W="/verify-email-otp",J="/verify-magiclink",H="/oauth/callback",Z="/register-passkey",Q="/magic-link-sent";function X(e,r){void 0===r&&(r={});var o=r.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===o&&i.firstChild?i.insertBefore(n,i.firstChild):i.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}}var $="login-module__container___YggDx",ee="login-module__card___Ub-Py",re="login-module__heading___neEqb",oe="login-module__inputGroup___P6qgS",ie="login-module__label___mx5vu",ne="login-module__input___U07lW",ae="login-module__helperText___kDQ4-",se="login-module__error___40zxh",te="login-module__button___0kFBs",le="login-module__submitHint___qOS5Z",ce="login-module__toggle___1JiG1",de="login-module__fallbackCard___HdIk-",_e="login-module__fallbackHeader___-il2v",me="login-module__fallbackDescription___ea5EB",ue="login-module__fallbackActions___AD3ni",ge="login-module__fallbackActionButton___lFgWf",fe="login-module__actionTitle___ycrMp",pe="login-module__actionSubtext___opaIV",he="login-module__linkButton___5lsoe";X(".login-module__container___YggDx{align-items:center;color:var(--seamless-text,#fff);display:flex;justify-content:center}.login-module__card___Ub-Py{background-color:var(--seamless-surface,#1f2937);border-radius:.5rem;box-shadow:0 4px 6px var(--seamless-shadow,rgba(0,0,0,.1));max-width:28rem;padding:2rem;width:100%}.login-module__heading___neEqb{color:var(--seamless-text,#fff);font-size:1.5rem;font-weight:700;margin-bottom:1.5rem;text-align:center}.login-module__message___qSejT{color:var(--seamless-success,#68d391);text-align:center}.login-module__inputGroup___P6qgS{margin-bottom:1rem}.login-module__label___mx5vu{color:var(--seamless-text-muted,#d1d5db);display:block}.login-module__input___U07lW{background-color:var(--seamless-surface-raised,#4b5563);border:1px solid var(--seamless-border,#d1d5db);border-radius:.375rem;margin-top:.25rem;padding:.5rem;width:100%}.login-module__input___U07lW:focus{box-shadow:0 0 0 2px var(--seamless-accent,#3b82f6);outline:none}.login-module__helperText___kDQ4-{color:var(--seamless-text-muted,#9ca3af);font-size:.75rem;margin-top:.5rem}.login-module__error___40zxh{color:var(--seamless-danger,#f87171);font-size:.875rem}.login-module__button___0kFBs{background-color:var(--seamless-accent,#2563eb);border-radius:.375rem;color:var(--seamless-accent-contrast,#fff);cursor:pointer;margin-top:1rem;padding:.5rem;transition:background-color .3s,opacity .3s;width:100%}.login-module__button___0kFBs:hover:not(:disabled){background-color:var(--seamless-accent-hover,#1d4ed8)}.login-module__button___0kFBs:disabled{cursor:not-allowed;opacity:.6}.login-module__submitHint___qOS5Z{color:var(--seamless-text-muted,#9ca3af);font-size:.75rem;margin-top:.5rem;text-align:center}.login-module__toggle___1JiG1{background:none;border:none;color:var(--seamless-accent-soft,#60a5fa);cursor:pointer;font-size:.875rem;margin-top:1.5rem;text-align:center;width:100%}.login-module__underline___gs-RS{text-decoration:underline}.login-module__phoneRow___oeNtq{display:grid;gap:.5rem;grid-template-columns:1fr 3fr;margin-top:.25rem}.login-module__phoneInput___2MPQC,.login-module__select___rRV1O{background-color:var(--seamless-surface-raised,#4b5563);border:1px solid var(--seamless-border,#d1d5db);border-radius:.375rem;padding:.5rem;width:100%}@media (max-width:500px){.login-module__phoneRow___oeNtq{grid-template-columns:1fr}}.login-module__fallbackCard___HdIk-{background:var(--seamless-surface-raised,hsla(0,0%,100%,.04));border:1px solid var(--seamless-border,hsla(0,0%,100%,.08));border-radius:12px;display:flex;flex-direction:column;gap:14px;margin-top:18px;padding:18px}.login-module__fallbackHeader___-il2v{color:var(--seamless-text,#f3f4f6);font-size:.95rem;font-weight:600}.login-module__fallbackDescription___ea5EB{color:var(--seamless-text-muted,#9ca3af);font-size:.85rem;line-height:1.4}.login-module__fallbackActions___AD3ni{display:flex;flex-direction:column;gap:10px}.login-module__fallbackActionButton___lFgWf{background:var(--seamless-surface,rgba(0,0,0,.25));border:1px solid var(--seamless-border,hsla(0,0%,100%,.08));border-radius:8px;cursor:pointer;display:flex;flex-direction:column;padding:12px 14px;text-align:left;transition:all .15s ease}.login-module__fallbackActionButton___lFgWf:hover{background:var(--seamless-surface-hover,hsla(0,0%,100%,.06));border-color:var(--seamless-border,hsla(0,0%,100%,.15))}.login-module__actionTitle___ycrMp{color:var(--seamless-text,#f9fafb);font-size:.9rem;font-weight:500}.login-module__actionSubtext___opaIV{color:var(--seamless-text-muted,#9ca3af);font-size:.75rem;margin-top:2px}.login-module__linkButton___5lsoe{background:none;border:none;color:var(--seamless-accent-soft,#60a5fa);cursor:pointer;font-size:.8rem;margin-top:6px}.login-module__linkButton___5lsoe:hover{text-decoration:underline}");const ve=({identifier:o,onMagicLink:i,onEmailOtp:n,onPhoneOtp:a,onPasskeyRetry:s,loginMethods:t})=>{const l=h(o,t,{emailOtp:Boolean(n),passkeyRetry:Boolean(s)});return v(l)?e("div",{className:de,children:[r("div",{className:_e,children:"Choose a sign-in method"}),r("p",{className:me,children:"Choose another secure sign-in method."}),e("div",{className:ue,children:[l.magicLink&&e("button",{type:"button",className:ge,onClick:i,children:[r("span",{className:fe,children:"Email Magic Link"}),r("span",{className:pe,children:"Send a secure sign-in link to your email"})]}),l.emailOtp&&e("button",{type:"button",className:ge,onClick:n,children:[r("span",{className:fe,children:"Email Code"}),r("span",{className:pe,children:"Receive a one-time code by email"})]}),l.phoneOtp&&e("button",{type:"button",className:ge,onClick:a,children:[r("span",{className:fe,children:"Text Message Code"}),r("span",{className:pe,children:"Receive a one-time code via SMS"})]})]}),l.passkeyRetry&&r("button",{type:"button",className:he,onClick:s,children:"Try passkey anyway"})]}):null},be=()=>{const{listOAuthProviders:o,startOAuthLogin:n,finishOAuthLogin:a,ports:s}=d(),t=i(b),[l,c]=g([]),[_,m]=g("");if(f(()=>{let e=!0;return o().then(({data:r})=>{e&&c(r?.providers??[])}),()=>{e=!1}},[o]),0===l.length)return null;return e("div",{className:ue,children:[l.map(o=>r("button",{type:"button",className:ge,onClick:()=>(async e=>{m("");const r=new URL(t,window.location.origin).toString(),{error:o}=await y({actions:{startOAuthLogin:n,finishOAuthLogin:a},oauthRedirect:s.oauthRedirect},{providerId:e,redirectUri:r});o&&m(o)})(o.id),children:e("span",{className:fe,children:["Continue with ",o.name]})},o.id)),_&&r("p",{className:se,children:_})]})},ye=()=>{const i=n(),{hasSignedInBefore:a,login:s,handlePasskeyLogin:t}=d(),l=_(),{passkeySupported:c}=m(),{loginMethods:p}=u(),[h,v]=g(""),[b,y]=g(""),[M,T]=g("register"),[C,O]=g(""),[B,I]=g(""),[S,z]=g(""),[L,q]=g(!1),[A,D]=g(null);f(()=>{a&&T("login")},[a]);const R=()=>"login"===M?k(h)||x(h):k(b);return r("div",{className:$,children:e("div",{className:ee,children:[r("h2",{className:re,children:"login"===M?"Sign In":"Create Account"}),e(o,{children:[e("form",{onSubmit:async e=>{e.preventDefault(),O(""),q(!1);try{if("login"===M){const e=await w({login:s,handlePasskeyLogin:t},{identifier:h,passkeySupported:c,configuredMethods:p});return"error"===e.kind?void O(e.message):"signed_in"===e.kind?void i("/"):(D(e.loginMethods),q(!0),void(e.passkeyFailed&&O(N)))}"register"===M&&await(async()=>{O("");const{error:e}=await P(l,b);e?O(e):i(W)})()}catch{console.error("Failed to continue sign-in."),O("Failed to continue sign-in. Please try again.")}},children:["login"===M&&e("div",{className:oe,children:[r("label",{htmlFor:"identifier",className:ie,children:"Email Address / Phone Number"}),r("input",{id:"identifier",type:"text",value:h,onChange:e=>{const r=e.target.value;v(r)},autoComplete:"off",placeholder:"Email or Phone Number",className:ne,onBlur:()=>{if(h){const e=k(h)||x(h);z(e?"":"Please enter a valid email or phone number")}},required:!0}),r("p",{className:ae,children:"Phone numbers must include a country code e.g. +1"}),L&&r(ve,{identifier:h,onMagicLink:async()=>{const{error:e}=await l.requestMagicLink();e?O("Failed to send magic link."):i(Q,{state:{identifier:h}})},onEmailOtp:async()=>{const{error:e}=await l.requestLoginEmailOtp();e?O("Failed to send email code."):i(W,{state:{flow:"login"}})},onPhoneOtp:async()=>{const{error:e}=await l.requestLoginPhoneOtp();e?O("Failed to send OTP."):i(Y,{state:{flow:"login"}})},onPasskeyRetry:c?t:void 0,loginMethods:A}),S&&r("p",{className:se,children:S})]}),"register"===M&&e("div",{className:oe,children:[r("label",{htmlFor:"email",className:ie,children:"Email Address"}),r("input",{id:"email",type:"email",value:b,onChange:e=>{const r=e.target.value;y(r)},autoComplete:"off",className:ne,onBlur:()=>{if(b){const e=k(b);I(e?"":"Please enter a valid email")}},required:!0}),B&&r("p",{className:se,children:B})]}),r("button",{type:"submit",className:te,disabled:!R(),"aria-describedby":"seamless-submit-hint",children:"login"===M?"Login":"Register"}),r("p",{id:"seamless-submit-hint",role:"status",className:le,children:"login"===M?h?R()?"Ready to continue.":"This does not look like a complete email or phone number yet.":"Enter your email or phone number to continue.":b?R()?"Ready to continue.":"This does not look like a complete email address yet.":"Enter your email address to continue."}),C&&r("p",{className:se,children:C}),r("button",{type:"button",onClick:()=>T("login"===M?"register":"login"),className:ce,children:"login"===M?"Don't have an account? Create one":"Already have an account? Sign in"})]}),r(be,{})]})]})})};var ke={container:"passKeyLogin-module__container___IUKxF",card:"passKeyLogin-module__card___2sKM1",title:"passKeyLogin-module__title___HZxvc",button:"passKeyLogin-module__button___FvR4I"};X(".passKeyLogin-module__container___IUKxF{align-items:center;color:var(--seamless-text,#fff);display:flex;justify-content:center;padding:1rem}.passKeyLogin-module__card___2sKM1{background-color:var(--seamless-surface,#1f2937);border-radius:1rem;box-shadow:0 4px 20px var(--seamless-shadow,rgba(0,0,0,.4));display:flex;flex-direction:column;gap:1.5rem;max-width:400px;padding:2rem;width:100%}.passKeyLogin-module__title___HZxvc{color:var(--seamless-text,#fff);font-size:1.5rem;font-weight:600;text-align:center}.passKeyLogin-module__button___FvR4I{background-color:var(--seamless-accent,#2563eb);border:1px solid var(--seamless-accent,#3b82f6);border-radius:.5rem;color:var(--seamless-accent-contrast,#fff);cursor:pointer;font-weight:500;padding:.75rem 1rem;text-align:center;transition:background-color .2s ease;width:100%}.passKeyLogin-module__button___FvR4I:hover{background-color:var(--seamless-accent-hover,#1d4ed8)}@media (max-width:480px){.passKeyLogin-module__card___2sKM1{padding:1.25rem}.passKeyLogin-module__button___FvR4I{font-size:1rem}}");const xe=()=>{const o=n(),{handlePasskeyLogin:i}=d(),[a,s]=g("");return r("div",{className:ke.container,children:e("div",{className:ke.card,children:[r("h2",{className:ke.title,children:"Login with Passkey"}),r("button",{onClick:async()=>{s("");const{error:e}=await i();e?s("Passkey sign-in could not be completed. Try another sign-in method."):o("/")},className:ke.button,children:"Use Passkey"}),a&&r("p",{className:ke.error,children:a})]})})};var we="registerPasskey-module__container___jqEh8",Ne="registerPasskey-module__card___MJAyC",Pe="registerPasskey-module__loading___Q4i1x",Me="registerPasskey-module__spinner___V1nhd",Te="registerPasskey-module__supported___ihTih",Ce="registerPasskey-module__title___vn2Qu",Oe="registerPasskey-module__description___AWmO-",Be="registerPasskey-module__button___D3b4B",Ie="registerPasskey-module__message___RiOw-",Se="registerPasskey-module__success___HP5aX",ze="registerPasskey-module__error___hGiqE",Le="registerPasskey-module__skip___1hDyU",qe="registerPasskey-module__secondary___bnOB4";X(".registerPasskey-module__container___jqEh8{align-items:center;color:var(--seamless-text,#fff);display:flex;justify-content:center;padding:1rem}.registerPasskey-module__card___MJAyC{background-color:var(--seamless-surface,#1f2937);border-radius:1rem;box-shadow:0 4px 20px var(--seamless-shadow,rgba(0,0,0,.4));max-width:400px;padding:1.5rem;width:100%}.registerPasskey-module__loading___Q4i1x{align-items:center;background-color:var(--seamless-surface,#f9fafb);border-radius:.75rem;box-shadow:0 2px 8px var(--seamless-shadow,rgba(0,0,0,.1));color:var(--seamless-text,#374151);display:flex;font-weight:500;gap:.75rem;justify-content:center;padding:1.5rem}.registerPasskey-module__spinner___V1nhd{animation:registerPasskey-module__spin___oYcsC 1s linear infinite;border-bottom:2px solid var(--seamless-accent,#3b82f6);border-left:2px solid transparent;border-radius:9999px;border-right:2px solid transparent;border-top:2px solid var(--seamless-accent,#3b82f6);height:1.5rem;width:1.5rem}@keyframes registerPasskey-module__spin___oYcsC{to{transform:rotate(1turn)}}.registerPasskey-module__supported___ihTih{background-color:var(--seamless-surface,#ecfdf5);border-radius:.75rem;box-shadow:0 2px 12px var(--seamless-shadow,rgba(0,0,0,.1));color:var(--seamless-text,#065f46);padding:1.25rem}.registerPasskey-module__title___vn2Qu{font-size:1.125rem;font-weight:600;margin-bottom:.5rem}.registerPasskey-module__description___AWmO-{margin-bottom:1rem}.registerPasskey-module__button___D3b4B{background-color:var(--seamless-accent,#059669);border:none;border-radius:.5rem;color:var(--seamless-accent-contrast,#fff);cursor:pointer;font-weight:500;padding:.75rem 1rem;transition:background-color .2s ease;width:100%}.registerPasskey-module__button___D3b4B:hover{background-color:var(--seamless-accent-hover,#047857)}.registerPasskey-module__message___RiOw-{font-size:.875rem;margin-top:1rem}.registerPasskey-module__success___HP5aX{color:var(--seamless-success,#6ee7b7)}.registerPasskey-module__error___hGiqE{color:var(--seamless-danger,#f87171)}.registerPasskey-module__skip___1hDyU{background:none;border:none;color:var(--seamless-accent-soft,#60a5fa);cursor:pointer;font-size:.875rem;margin-top:1.5rem;text-align:center;width:100%}.registerPasskey-module__skip___1hDyU:disabled{cursor:default;opacity:.6}.registerPasskey-module__secondary___bnOB4{background:none;border:1px solid var(--seamless-accent,#059669);border-radius:.5rem;color:var(--seamless-accent,#059669);cursor:pointer;font-weight:500;margin-top:.75rem;padding:.75rem 1rem;transition:background-color .2s ease;width:100%}.registerPasskey-module__secondary___bnOB4:hover:not(:disabled){background-color:var(--seamless-accent-muted,rgba(5,150,105,.1))}.registerPasskey-module__secondary___bnOB4:disabled{cursor:default;opacity:.6}");const Ae=()=>{const{refreshSession:o}=d(),i=_(),{passkeySupported:s,loading:t}=m(),{loginMethods:l,loading:c}=u(),f=n(),p=M(a().state?.returnTo),[h,v]=g("idle"),[b,y]=g(""),k=T(l),x=async()=>{await o(),f(p)},w=async e=>{v("loading");const{error:r}=await C({client:i,refreshSession:o},e);if(r)return v("error"),void y(r);v("success"),y("Passkey registered successfully."),f(p)};return r("div",{className:we,children:r("div",{className:Ne,children:e("div",t||c?{className:Pe,children:[r("div",{className:Me}),r("span",{children:"Checking for Passkey Support..."})]}:s?{className:Te,children:[r("h2",{className:Ce,children:"Secure Your Account with a Passkey"}),r("p",{className:Oe,children:"Your device supports passkeys! Register one to skip passwords forever."}),r("button",{onClick:()=>w(),disabled:"loading"===h,className:Be,children:"loading"===h?"Registering...":"Register Passkey"}),r("button",{type:"button",onClick:()=>w("cross-platform"),disabled:"loading"===h,className:qe,children:"Use a security key instead"}),b&&r("p",{className:`${Ie} ${"success"===h?Se:ze}`,children:b}),k&&r("button",{type:"button",onClick:x,disabled:"loading"===h,className:Le,children:"Skip for now"})]}:{className:Te,children:[r("h2",{className:Ce,children:"Passkeys are not available here"}),r("p",{className:Oe,children:k?"This device does not support passkeys. You can continue without one and add a passkey later from a device that does.":"This device does not support passkeys, and this application requires one to sign in. Try again from a device or browser that supports them."}),k&&r("button",{type:"button",onClick:x,className:Be,children:"Continue"})]})})})};var De="verifyOTP-module__container___wgoDE",Re="verifyOTP-module__card___3cs2p",Ee="verifyOTP-module__title___fZ-1d",je="verifyOTP-module__subtitle___dGSu3",Fe="verifyOTP-module__error___GEtlG",Ge="verifyOTP-module__success___46TjG",Ve="verifyOTP-module__form___jiGG-",Ue="verifyOTP-module__label___Zq5Mi",Ke="verifyOTP-module__timer___smq-a",Ye="verifyOTP-module__resend___PlmkG",We="verifyOTP-module__button___8pIuO",Je="verifyOTP-module__toggle___wbzVa";X(".verifyOTP-module__container___wgoDE{align-items:center;color:var(--seamless-text,#fff);display:flex;justify-content:center;padding:1rem}.verifyOTP-module__card___3cs2p{background-color:var(--seamless-surface,#1f2937);border-radius:.5rem;box-shadow:0 0 10px var(--seamless-shadow,rgba(0,0,0,.3));max-width:28rem;padding:1.5rem;width:100%}.verifyOTP-module__title___fZ-1d{color:var(--seamless-text,#fff);font-size:1.5rem;font-weight:700;margin-bottom:1rem;text-align:center}.verifyOTP-module__subtitle___dGSu3{color:var(--seamless-text-muted,#9ca3af);font-size:.875rem;margin-bottom:1.5rem;text-align:center}.verifyOTP-module__error___GEtlG{color:var(--seamless-danger,#f87171);margin-bottom:1rem;text-align:center}.verifyOTP-module__success___46TjG{color:var(--seamless-success,#34d399);margin-bottom:.75rem;text-align:center}.verifyOTP-module__form___jiGG-{display:flex;flex-direction:column;gap:1rem}.verifyOTP-module__label___Zq5Mi{color:var(--seamless-text-muted,#d1d5db);display:block;font-size:.875rem;margin-bottom:.25rem}.verifyOTP-module__timer___smq-a{color:var(--seamless-warning,#facc15);font-size:.875rem}.verifyOTP-module__input___yqIXM{background-color:var(--seamless-surface-raised,#374151);border:1px solid var(--seamless-border,#4b5563);border-radius:.375rem;color:var(--seamless-text,#fff);outline:none;padding:.5rem;width:100%}.verifyOTP-module__input___yqIXM:focus{box-shadow:0 0 0 2px var(--seamless-accent,#3b82f6)}.verifyOTP-module__resend___PlmkG{background:none;border:none;color:var(--seamless-accent-soft,#60a5fa);cursor:pointer;font-size:.75rem;margin-top:.25rem;text-decoration:underline}.verifyOTP-module__resend___PlmkG:hover{color:var(--seamless-accent,#3b82f6)}.verifyOTP-module__button___8pIuO{background-color:var(--seamless-accent,#2563eb);border:none;border-radius:.375rem;color:var(--seamless-accent-contrast,#fff);cursor:pointer;padding:.5rem;transition:background-color .2s;width:100%}.verifyOTP-module__button___8pIuO:hover{background-color:var(--seamless-accent-hover,#1d4ed8)}.verifyOTP-module__toggle___wbzVa{background:none;border:none;color:var(--seamless-accent-soft,#60a5fa);cursor:pointer;font-size:.875rem;margin-top:1.5rem;text-align:center;width:100%}");var He="otpInput-module__otpContainer___MUjby",Ze="otpInput-module__otpInput___3YMVm";X(".otpInput-module__otpContainer___MUjby{display:flex;gap:8px;justify-content:center;margin-top:8px}.otpInput-module__otpInput___3YMVm{background:var(--seamless-surface-raised,#374151);border:1px solid var(--seamless-border,#4b5563);border-radius:8px;color:var(--seamless-text,#fff);font-size:1.2rem;height:48px;text-align:center;transition:border-color .15s ease,box-shadow .15s ease;width:42px}.otpInput-module__otpInput___3YMVm:focus{border-color:var(--seamless-accent,#60a5fa);box-shadow:0 0 0 2px var(--seamless-accent,rgba(96,165,250,.25));outline:none}");const Qe=({length:e=6,value:o,inputMode:i="numeric",onChange:n,name:a="otp"})=>{const s=p([]),t=o.split("").concat(Array(e).fill("")).slice(0,e),l=(r,o)=>{const a=B(o,i).slice(0,e),l=[...t];a.forEach((o,i)=>{r+i<e&&(l[r+i]=o)}),n(l.join("")),s.current[Math.min(r+a.length,e-1)]?.focus()};return r("div",{className:He,role:"group","aria-label":"One-time password input",onPaste:e=>{e.preventDefault(),l(0,e.clipboardData.getData("text"))},children:t.map((o,c)=>r("input",{ref:e=>s.current[c]=e,type:"text",inputMode:"numeric"===i?"numeric":"text",autoComplete:"one-time-code",name:`${a}-${c}`,maxLength:1,value:o,className:Ze,onChange:e=>((e,r)=>{if(r.length>1)l(e,r);else if(!r||O(r,i)){const o=[...t];o[e]=r;const i=o.join("");n(i),r&&s.current[e+1]&&s.current[e+1]?.focus()}})(c,e.target.value),onKeyDown:r=>((r,o)=>{if("Backspace"===o.key){o.preventDefault();const e=[...t];t[r]?(e[r]="",n(e.join(""))):r>0&&(e[r-1]="",n(e.join("")),s.current[r-1]?.focus())}"ArrowLeft"===o.key&&r>0&&s.current[r-1]?.focus(),"ArrowRight"===o.key&&r<e-1&&s.current[r+1]?.focus()})(c,r),"aria-label":`Digit ${c+1}`},c))})},Xe=()=>{const o=n(),i=a(),{refreshSession:s}=d(),t="login"===i.state?.flow,[l,c]=g(""),[m,u]=g(null),[p,h]=g(""),[v,b]=g(!1),[y,k]=g(""),[x,w]=g(I),N=_(),P=async()=>{if(m)return;const{next:e,error:r}=await L({client:N,refreshSession:s},{channel:"phone",flow:t?"login":"register",code:l});if(null===r)return"verify_email"===e?(u(!0),void o(W)):void o("/");h(r)},M=async()=>{k(""),await(async()=>{h("");const{error:e}=await q(N,"phone",t?"login":"register");e?h(A("phone")):k("Verification SMS has been resent.")})(),k("Verification SMS has been resent.")};return f(()=>{const e=setInterval(()=>{w(e=>e>0?e-1:0)},1e3);return()=>clearInterval(e)},[]),r("div",{className:De,children:e("div",{className:Re,children:[r("h2",{className:Ee,children:"Verify Your Phone Number"}),r("p",{className:je,children:"Enter the code sent to your phone number."}),p&&r("p",{className:Fe,children:p}),y&&r("p",{className:Ge,children:y}),e("form",{onSubmit:async e=>{if(e.preventDefault(),h(""),l.length===z){b(!0);try{await P()}catch{h("Unexpected error occurred.")}finally{b(!1)}}else h("Please enter a valid code.")},className:Ve,children:[e("div",{children:[e("label",{htmlFor:"phoneCode",className:Ue,children:["Phone Verification Code ",(T=m,!0===T?r("span",{className:"text-green-400 ml-2",children:"✅"}):!1===T?r("span",{className:"text-red-400 ml-2",children:"❌"}):null)," -"," ",e("span",{className:Ke,children:["Code expires in: ",S(x)]})]}),r(Qe,{length:6,value:l,onChange:c}),r("button",{type:"button",onClick:()=>M(),className:Ye,children:"Resend code to phone"})]}),r("button",{type:"submit",className:We,children:v?"Verifying...":"Verify & Continue"}),r("button",{type:"button",onClick:()=>o("/login"),className:Je,children:"Back to login"})]})]})});var T},$e=()=>{const o=n(),i=a(),{refreshSession:s}=d(),t=_(),{passkeySupported:l}=m(),c="login"===i.state?.flow,[u,p]=g(!1),[h,v]=g(""),[b,y]=g(I),[k,x]=g(""),[w,N]=g("");return f(()=>{const e=setInterval(()=>{y(e=>e>0?e-1:0)},1e3);return()=>clearInterval(e)},[]),r("div",{className:De,children:e("div",{className:Re,children:[r("h2",{className:Ee,children:"Verify Your Email"}),r("p",{className:je,children:"We sent you a verification email. Enter the code below."}),k&&r("p",{className:Fe,children:k}),w&&r("p",{className:Ge,children:w}),e("form",{onSubmit:async e=>{if(e.preventDefault(),x(""),h.length===z){p(!0);try{const{next:e,error:r}=await L({client:t,refreshSession:s},{channel:"email",flow:c?"login":"register",code:h,passkeySupported:l});if(null!==r)return void x(r);o("register_passkey"===e?Z:"/")}catch{console.error("Email OTP verification failed."),x("Verification failed.")}finally{p(!1)}}else x("Please enter a valid code.")},className:Ve,children:[e("div",{children:[e("label",{htmlFor:"emailCode",className:Ue,children:["Email Verification Code",e("span",{className:Ke,children:[" ","— Code expires in ",S(b)]})]}),r(Qe,{length:6,value:h,onChange:v,inputMode:"text"}),r("button",{type:"button",onClick:async()=>{x(""),N("");const{error:e}=await q(t,"email",c?"login":"register");e?x(A("email")):N("Verification email has been resent.")},className:Ye,children:"Resend code to email"})]}),r("button",{type:"submit",className:We,disabled:u,children:u?"Verifying...":"Verify & Continue"}),r("button",{type:"button",onClick:()=>o("/login"),className:Je,children:"Back to login"})]})]})})};var er="verifyMagiclink-module__container___qrSXf",rr="verifyMagiclink-module__card___niKgr",or="verifyMagiclink-module__title___SumxD",ir="verifyMagiclink-module__verificationContent___NdsS0",nr="verifyMagiclink-module__spinner___lnW1k",ar="verifyMagiclink-module__successIcon___XjFEM",sr="verifyMagiclink-module__checkIcon___I0JOP",tr="verifyMagiclink-module__prompt___tvPn4",lr="verifyMagiclink-module__helperText___ggTZw",cr="verifyMagiclink-module__actions___6Jf29",dr="verifyMagiclink-module__primaryButton___8DcTo",_r="verifyMagiclink-module__secondaryButton___8n-GU",mr="verifyMagiclink-module__error___tfBn0",ur="verifyMagiclink-module__successText___lO5Qq";X(".verifyMagiclink-module__container___qrSXf{align-items:center;color:var(--seamless-text,#fff);display:flex;justify-content:center;padding:1rem}.verifyMagiclink-module__card___niKgr{background-color:var(--seamless-surface,#1f2937);border-radius:.5rem;box-shadow:0 0 10px var(--seamless-shadow,rgba(0,0,0,.3));max-width:28rem;padding:1.5rem;width:100%}.verifyMagiclink-module__title___SumxD{color:var(--seamless-text,#fff);font-size:1.5rem;font-weight:700;margin-bottom:1rem;text-align:center}.verifyMagiclink-module__verificationContent___NdsS0{align-items:center;display:flex;flex-direction:column;gap:14px;margin:20px 0}.verifyMagiclink-module__spinner___lnW1k{animation:verifyMagiclink-module__spin___2lGzj .9s linear infinite;border:3px solid var(--seamless-border,hsla(0,0%,100%,.15));border-radius:50%;border-top-color:var(--seamless-accent,#60a5fa);height:28px;width:28px}.verifyMagiclink-module__successIcon___XjFEM{align-items:center;background:rgba(16,185,129,.15);border-radius:50%;display:flex;height:36px;justify-content:center;width:36px}.verifyMagiclink-module__checkIcon___I0JOP{animation:verifyMagiclink-module__checkPop___-3qJu .25s ease-out;color:var(--seamless-success,#34d399);height:22px;width:22px}.verifyMagiclink-module__prompt___tvPn4{font-weight:600;line-height:1.4;text-align:center}.verifyMagiclink-module__helperText___ggTZw{color:var(--seamless-text-muted,#9ca3af);font-size:.875rem;line-height:1.4;text-align:center}.verifyMagiclink-module__actions___6Jf29{display:flex;flex-direction:column;gap:.6rem;width:100%}.verifyMagiclink-module__primaryButton___8DcTo{background-color:var(--seamless-accent,#2563eb);border:none;border-radius:.375rem;color:var(--seamless-accent-contrast,#fff);cursor:pointer;font:inherit;font-weight:500;padding:.65rem;width:100%}.verifyMagiclink-module__primaryButton___8DcTo:hover:not(:disabled){background-color:var(--seamless-accent-hover,#1d4ed8)}.verifyMagiclink-module__secondaryButton___8n-GU{background:transparent;border:1px solid var(--seamless-border,#374151);border-radius:.375rem;color:var(--seamless-text,#fff);cursor:pointer;font:inherit;padding:.65rem;width:100%}.verifyMagiclink-module__secondaryButton___8n-GU:hover:not(:disabled){background:var(--seamless-surface-hover,#1f2937)}.verifyMagiclink-module__primaryButton___8DcTo:disabled,.verifyMagiclink-module__secondaryButton___8n-GU:disabled{cursor:not-allowed;opacity:.6}.verifyMagiclink-module__error___tfBn0{color:var(--seamless-danger,#f87171);text-align:center}.verifyMagiclink-module__successText___lO5Qq{color:var(--seamless-success,#34d399);font-size:.9rem}@keyframes verifyMagiclink-module__checkPop___-3qJu{0%{opacity:0;transform:scale(.6)}80%{transform:scale(1.15)}to{opacity:1;transform:scale(1)}}@keyframes verifyMagiclink-module__spin___2lGzj{to{transform:rotate(1turn)}}");const gr=()=>{const[i]=s(),a=n(),t=i.get("token"),[l,c]=g(""),[m,u]=g(null),[h,v]=g(null),[b,y]=g("pending"),[k,x]=g(""),w=_(),{refreshSession:N}=d(),P=p(null);f(()=>{let e=!0,r=null;return(async()=>{if(!t)return e&&c("Missing token for verification."),void console.error("No magic-link token found.");P.current?.token!==t&&(P.current={token:t,result:w.verifyMagicLink(t)});const{error:o}=await P.current.result;if(!e)return;if(o){const e=R(o);return e?void v(e):(console.error("Failed to verify token"),void c("Failed to verify token"))}const i=await E({client:w,refreshSession:N});e&&(u(i),"elsewhere"!==i&&(r=setTimeout(()=>{e&&a("/")},900)))})(),()=>{e=!1,r&&clearTimeout(r)}},[t,w,a,N]);return r("div",h?{className:er,children:e("div",{className:rr,children:[r("h1",{className:or,children:"Confirm this sign-in"}),e("div",{className:ir,children:[("pending"===b||"confirming"===b)&&e(o,{children:[r("p",{className:tr,children:D(h)}),r("p",{className:lr,children:"This link was opened on a different device from the one that asked for it. Only continue if you made that request."}),e("div",{className:cr,children:[r("button",{type:"button",className:dr,disabled:"confirming"===b,onClick:()=>{(async()=>{if(!t||"confirming"===b)return;y("confirming"),x("");const{error:e}=await j({client:w,token:t});if(e)return y("pending"),void x("We could not confirm this sign-in. The link may have expired or already been used.");y("confirmed")})()},children:"Yes, sign in that device"}),r("button",{type:"button",className:_r,disabled:"confirming"===b,onClick:()=>y("declined"),children:"No, this wasn't me"})]}),k&&r("p",{className:mr,role:"alert",children:k})]}),"confirmed"===b&&r("p",{className:ur,role:"status",children:"Sign-in approved. You can return to your other device to continue."}),"declined"===b&&r("p",{className:lr,role:"status",children:"No one has been signed in. You can ignore the email and close this page."})]})]})}:{className:er,children:e("div",{className:rr,children:[r("h1",{className:or,children:"Verifying your login"}),e("div",{className:ir,children:[!m&&!l&&r("div",{className:nr}),m&&r("div",{className:ar,children:r("svg",{viewBox:"0 0 24 24",className:sr,fill:"none",stroke:"currentColor",strokeWidth:"2",children:r("path",{d:"M5 13l4 4L19 7"})})}),!m&&!l&&r("p",{className:lr,children:"Please wait while we securely verify your sign-in link."}),"signed-in"===m&&r("p",{className:ur,children:"Login verified. Redirecting…"}),"elsewhere"===m&&r("p",{className:ur,children:"Login verified. Return to the device where you requested this link to continue."}),l&&r("p",{className:mr,children:l})]})]})})},fr=()=>{const{finishOAuthLogin:i}=d(),a=n(),[t]=s(),[l,c]=g(""),_=p(!1);return f(()=>{_.current||(_.current=!0,F({finishOAuthLogin:i},t,window.location.origin).then(e=>{"error"!==e.kind?"enroll_passkey"!==e.kind?a(e.destination):a(Z,{state:{returnTo:e.returnTo}}):c(e.message)}))},[i,a,t]),e("div",{className:er,children:[r("h2",{className:or,children:l?"Sign-in failed":"Completing sign-in..."}),l&&e(o,{children:[r("p",{children:l}),r("button",{type:"button",onClick:()=>a("/login"),children:"Back to login"})]})]})};var pr="magiclink-module__container___45zcA",hr="magiclink-module__card___Au9oN",vr="magiclink-module__iconWrapper___k5ndr",br="magiclink-module__mailIcon___Pwb7q",yr="magiclink-module__iconRing___bdLvf",kr="magiclink-module__heading___b9cre",xr="magiclink-module__message___kiVFj",wr="magiclink-module__identifier___JtcFM",Nr="magiclink-module__helperText___7Mlfh",Pr="magiclink-module__actions___64I-3",Mr="magiclink-module__secondaryButton___BntAI",Tr="magiclink-module__cooldown___Ib4rm",Cr="magiclink-module__linkButton___maJiv";X(".magiclink-module__container___45zcA{align-items:center;color:var(--seamless-text,#fff);display:flex;justify-content:center}.magiclink-module__card___Au9oN{background-color:var(--seamless-surface,#1f2937);border-radius:.75rem;box-shadow:0 10px 25px var(--seamless-shadow,rgba(0,0,0,.25));max-width:420px;padding:2.5rem 2rem;text-align:center;width:100%}.magiclink-module__iconWrapper___k5ndr{display:flex;justify-content:center;margin-bottom:1.25rem;position:relative}.magiclink-module__mailIcon___Pwb7q{color:var(--seamless-accent-soft,#a5b4fc);height:38px;width:38px;z-index:2}.magiclink-module__iconRing___bdLvf{animation:magiclink-module__pulse___YGm-I 2s infinite;background:rgba(99,102,241,.15);border-radius:50%;height:72px;position:absolute;width:72px}@keyframes magiclink-module__pulse___YGm-I{0%{opacity:.8;transform:scale(.6)}70%{opacity:0;transform:scale(1.4)}to{opacity:0}}.magiclink-module__heading___b9cre{font-size:1.55rem;font-weight:600;margin-bottom:.75rem}.magiclink-module__message___kiVFj{color:var(--seamless-text-muted,#d1d5db);font-size:.95rem;line-height:1.4;margin-bottom:1rem}.magiclink-module__identifier___JtcFM{background:var(--seamless-surface-raised,hsla(0,0%,100%,.05));border-radius:6px;display:inline-block;font-size:1rem;font-weight:600;margin-bottom:1rem;padding:.45rem .6rem}.magiclink-module__helperText___7Mlfh{color:var(--seamless-text-muted,#9ca3af);font-size:.85rem;line-height:1.4;margin-bottom:.6rem}.magiclink-module__actions___64I-3{display:flex;flex-direction:column;gap:.6rem;margin-top:1.6rem}.magiclink-module__secondaryButton___BntAI{background:var(--seamless-surface,#111827);border:1px solid var(--seamless-border,#374151);border-radius:8px;color:var(--seamless-text,#fff);cursor:pointer;font-weight:500;padding:.65rem}.magiclink-module__secondaryButton___BntAI:hover:not(:disabled){background:var(--seamless-surface-hover,#1f2937)}.magiclink-module__secondaryButton___BntAI:disabled{cursor:not-allowed;opacity:.5}.magiclink-module__cooldown___Ib4rm{color:var(--seamless-text-muted,#9ca3af);font-size:.8rem}.magiclink-module__linkButton___maJiv{background:none;border:none;color:var(--seamless-accent-soft,#a5b4fc);cursor:pointer;font-size:.85rem;margin-top:.4rem}.magiclink-module__linkButton___maJiv:hover{text-decoration:underline}");const Or=()=>{const{refreshSession:o}=d(),i=n(),s=a(),t=_(),l=s.state?.identifier,[c,m]=g(G);f(()=>{const e=setInterval(()=>{m(e=>e>0?e-1:0)},1e3);return()=>clearInterval(e)},[]);return f(()=>V({client:t,refreshSession:o,onSignedIn:()=>i("/")}),[t,i,o]),r("div",{className:pr,children:e("div",{className:hr,children:[e("div",{className:vr,children:[r("div",{className:yr}),e("svg",{className:br,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",children:[r("path",{d:"M4 6h16v12H4z"}),r("path",{d:"m4 6 8 6 8-6"})]})]}),r("h2",{className:kr,children:"Check your email"}),r("p",{className:xr,children:"If an account exists for this address, we sent a secure sign-in link."}),l&&r("div",{className:wr,children:l}),r("p",{className:Nr,children:"Open the email and click the link to finish signing in."}),r("p",{className:Nr,children:"Didn’t receive anything? Check your spam folder or try creating a new account."}),e("div",{className:Pr,children:[r("button",{className:Mr,disabled:c>0,onClick:async()=>{c>0||(await t.requestMagicLink(),m(G))},children:"Resend link"}),c>0&&e("div",{className:Tr,children:["Available in ",c,"s"]}),r("button",{className:Cr,onClick:()=>i("/login"),children:"Change email or phone"})]})]})})},Br=()=>e(t,{children:[r(l,{path:U,element:r(ye,{})}),r(l,{path:K,element:r(xe,{})}),r(l,{path:Y,element:r(Xe,{})}),r(l,{path:W,element:r($e,{})}),r(l,{path:J,element:r(gr,{})}),r(l,{path:H,element:r(fr,{})}),r(l,{path:Z,element:r(Ae,{})}),r(l,{path:Q,element:r(Or,{})}),r(l,{path:"*",element:r(c,{to:U,replace:!0})})]});export{Br as AuthRoutes};
|
|
2
|
+
import{jsxs as e,jsx as r,Fragment as a}from"react/jsx-runtime";import{useHref as o,useNavigate as n,useLocation as i,useSearchParams as s,Routes as t,Route as l,Navigate as c}from"react-router-dom";import{s as d,b as m,u as _,c as u,e as h,f as g,O as p,g as f,d as y,R as v,a as b,T as k}from"./chunks/shared-GwBNo3wy.js";import{useState as x,useEffect as N,useRef as w}from"react";import{fallbackSignInOptions as P,hasFallbackSignInOption as C,OAUTH_CALLBACK_PATH as S,startOAuthSignIn as T,isValidEmail as M,isValidPhoneNumber as O,beginSignIn as B,PASSKEY_SIGN_IN_FAILED as I,registerWithEmail as R,safeReturnPath as q,hasNonPasskeyLoginMethod as A,enrollPasskey as L,OTP_LIFETIME_SECONDS as z,formatCountdown as F,OTP_LENGTH as G,verifyOtp as U,requestOtp as E,otpResendFailedMessage as D,magicLinkConfirmationPrompt as j,getMagicLinkConfirmation as V,finishMagicLinkSignIn as W,confirmMagicLinkSignIn as Y,completeOAuthCallback as K,recoveryErrorMessage as X,generateRecoveryCodesWithStepUp as J,getRecoveryErrorCode as Z,isUnauthenticated as H,signInWithTotp as Q,recoveryCancelTokenFromHash as $,cancelRecoveryFromLink as ee,MAGIC_LINK_RESEND_COOLDOWN_SECONDS as re,watchMagicLink as ae}from"@seamless-auth/client";const oe="/login",ne="/passkey-login",ie="/verify-phone-otp",se="/verify-email-otp",te="/verify-magiclink",le="/oauth/callback",ce="/register-passkey",de="/register-authenticator",me="/magic-link-sent",_e="/recovery-code",ue="/authenticator-code",he="/recovery-codes",ge="/account-recovery",pe="/recovery/cancel";var fe="login-module__container___YggDx",ye="login-module__card___Ub-Py",ve="login-module__heading___neEqb",be="login-module__inputGroup___P6qgS",ke="login-module__label___mx5vu",xe="login-module__input___U07lW",Ne="login-module__helperText___kDQ4-",we="login-module__error___40zxh",Pe="login-module__button___0kFBs",Ce="login-module__submitHint___qOS5Z",Se="login-module__toggle___1JiG1",Te="login-module__fallbackCard___HdIk-",Me="login-module__fallbackHeader___-il2v",Oe="login-module__fallbackDescription___ea5EB",Be="login-module__fallbackActions___AD3ni",Ie="login-module__fallbackActionButton___lFgWf",Re="login-module__actionTitle___ycrMp",qe="login-module__actionSubtext___opaIV",Ae="login-module__linkButton___5lsoe",Le="login-module__recoveryOptions___iP2ZA";d(".login-module__container___YggDx{align-items:center;color:var(--seamless-text,#fff);display:flex;justify-content:center}.login-module__card___Ub-Py{background-color:var(--seamless-surface,#1f2937);border-radius:.5rem;box-shadow:0 4px 6px var(--seamless-shadow,rgba(0,0,0,.1));max-width:28rem;padding:2rem;width:100%}.login-module__heading___neEqb{color:var(--seamless-text,#fff);font-size:1.5rem;font-weight:700;margin-bottom:1.5rem;text-align:center}.login-module__message___qSejT{color:var(--seamless-success,#68d391);text-align:center}.login-module__inputGroup___P6qgS{margin-bottom:1rem}.login-module__label___mx5vu{color:var(--seamless-text-muted,#d1d5db);display:block}.login-module__input___U07lW{background-color:var(--seamless-surface-raised,#4b5563);border:1px solid var(--seamless-border,#d1d5db);border-radius:.375rem;margin-top:.25rem;padding:.5rem;width:100%}.login-module__input___U07lW:focus{box-shadow:0 0 0 2px var(--seamless-accent,#3b82f6);outline:none}.login-module__helperText___kDQ4-{color:var(--seamless-text-muted,#9ca3af);font-size:.75rem;margin-top:.5rem}.login-module__error___40zxh{color:var(--seamless-danger,#f87171);font-size:.875rem}.login-module__button___0kFBs{background-color:var(--seamless-accent,#2563eb);border-radius:.375rem;color:var(--seamless-accent-contrast,#fff);cursor:pointer;margin-top:1rem;padding:.5rem;transition:background-color .3s,opacity .3s;width:100%}.login-module__button___0kFBs:hover:not(:disabled){background-color:var(--seamless-accent-hover,#1d4ed8)}.login-module__button___0kFBs:disabled{cursor:not-allowed;opacity:.6}.login-module__submitHint___qOS5Z{color:var(--seamless-text-muted,#9ca3af);font-size:.75rem;margin-top:.5rem;text-align:center}.login-module__toggle___1JiG1{background:none;border:none;color:var(--seamless-accent-soft,#60a5fa);cursor:pointer;font-size:.875rem;margin-top:1.5rem;text-align:center;width:100%}.login-module__underline___gs-RS{text-decoration:underline}.login-module__phoneRow___oeNtq{display:grid;gap:.5rem;grid-template-columns:1fr 3fr;margin-top:.25rem}.login-module__phoneInput___2MPQC,.login-module__select___rRV1O{background-color:var(--seamless-surface-raised,#4b5563);border:1px solid var(--seamless-border,#d1d5db);border-radius:.375rem;padding:.5rem;width:100%}@media (max-width:500px){.login-module__phoneRow___oeNtq{grid-template-columns:1fr}}.login-module__fallbackCard___HdIk-{background:var(--seamless-surface-raised,hsla(0,0%,100%,.04));border:1px solid var(--seamless-border,hsla(0,0%,100%,.08));border-radius:12px;display:flex;flex-direction:column;gap:14px;margin-top:18px;padding:18px}.login-module__fallbackHeader___-il2v{color:var(--seamless-text,#f3f4f6);font-size:.95rem;font-weight:600}.login-module__fallbackDescription___ea5EB{color:var(--seamless-text-muted,#9ca3af);font-size:.85rem;line-height:1.4}.login-module__fallbackActions___AD3ni{display:flex;flex-direction:column;gap:10px}.login-module__fallbackActionButton___lFgWf{background:var(--seamless-surface,rgba(0,0,0,.25));border:1px solid var(--seamless-border,hsla(0,0%,100%,.08));border-radius:8px;cursor:pointer;display:flex;flex-direction:column;padding:12px 14px;text-align:left;transition:all .15s ease}.login-module__fallbackActionButton___lFgWf:hover{background:var(--seamless-surface-hover,hsla(0,0%,100%,.06));border-color:var(--seamless-border,hsla(0,0%,100%,.15))}.login-module__actionTitle___ycrMp{color:var(--seamless-text,#f9fafb);font-size:.9rem;font-weight:500}.login-module__actionSubtext___opaIV{color:var(--seamless-text-muted,#9ca3af);font-size:.75rem;margin-top:2px}.login-module__linkButton___5lsoe{background:none;border:none;color:var(--seamless-accent-soft,#60a5fa);cursor:pointer;font-size:.8rem;margin-top:6px}.login-module__linkButton___5lsoe:hover{text-decoration:underline}.login-module__recoveryOptions___iP2ZA{align-items:flex-start;display:flex;flex-direction:column;margin-top:.75rem}");const ze=({identifier:a,onMagicLink:o,onEmailOtp:n,onPhoneOtp:i,onPasskeyRetry:s,loginMethods:t})=>{const l=P(a,t,{emailOtp:Boolean(n),passkeyRetry:Boolean(s)});return C(l)?e("div",{className:Te,children:[r("div",{className:Me,children:"Choose a sign-in method"}),r("p",{className:Oe,children:"Choose another secure sign-in method."}),e("div",{className:Be,children:[l.magicLink&&e("button",{type:"button",className:Ie,onClick:o,children:[r("span",{className:Re,children:"Email Magic Link"}),r("span",{className:qe,children:"Send a secure sign-in link to your email"})]}),l.emailOtp&&e("button",{type:"button",className:Ie,onClick:n,children:[r("span",{className:Re,children:"Email Code"}),r("span",{className:qe,children:"Receive a one-time code by email"})]}),l.phoneOtp&&e("button",{type:"button",className:Ie,onClick:i,children:[r("span",{className:Re,children:"Text Message Code"}),r("span",{className:qe,children:"Receive a one-time code via SMS"})]})]}),l.passkeyRetry&&r("button",{type:"button",className:Ae,onClick:s,children:"Try passkey anyway"})]}):null},Fe=()=>{const{listOAuthProviders:a,startOAuthLogin:n,finishOAuthLogin:i,ports:s}=m(),t=o(S),[l,c]=x([]),[d,_]=x("");if(N(()=>{let e=!0;return a().then(({data:r})=>{e&&c(r?.providers??[])}),()=>{e=!1}},[a]),0===l.length)return null;return e("div",{className:Be,children:[l.map(a=>r("button",{type:"button",className:Ie,onClick:()=>(async e=>{_("");const r=new URL(t,window.location.origin).toString(),{error:a}=await T({actions:{startOAuthLogin:n,finishOAuthLogin:i},oauthRedirect:s.oauthRedirect},{providerId:e,redirectUri:r});a&&_(a)})(a.id),children:e("span",{className:Re,children:["Continue with ",a.name]})},a.id)),d&&r("p",{className:we,children:d})]})},Ge=()=>{const o=n(),{hasSignedInBefore:i,login:s,handlePasskeyLogin:t,recoverySession:l}=m(),c=_(),{passkeySupported:d}=u(),{loginMethods:p}=h(),f=g(),[y,v]=x(""),[b,k]=x(""),[w,P]=x("register"),[C,S]=x(""),[T,q]=x(""),[A,L]=x(""),[z,F]=x(!1),[G,U]=x(null);N(()=>{i&&P("login")},[i]),N(()=>{l&&o(ce,{replace:!0})},[l,o]);const E=()=>"login"===w?M(y)||O(y):M(b);return r("div",{className:fe,children:e("div",{className:ye,children:[r("h2",{className:ve,children:"login"===w?"Sign In":"Create Account"}),e(a,{children:[e("form",{onSubmit:async e=>{e.preventDefault(),S(""),F(!1);try{if("login"===w){const e=await B({login:s,handlePasskeyLogin:t},{identifier:y,passkeySupported:d,configuredMethods:p});return"error"===e.kind?void S(e.message):"signed_in"===e.kind?void o("/"):(U(e.loginMethods),F(!0),void(e.passkeyFailed&&S(I)))}"register"===w&&await(async()=>{S("");const{error:e}=await R(c,b);e?S(e):o(se)})()}catch{console.error("Failed to continue sign-in."),S("Failed to continue sign-in. Please try again.")}},children:["login"===w&&e("div",{className:be,children:[r("label",{htmlFor:"identifier",className:ke,children:"Email Address / Phone Number"}),r("input",{id:"identifier",type:"text",value:y,onChange:e=>{const r=e.target.value;v(r)},autoComplete:"off",placeholder:"Email or Phone Number",className:xe,onBlur:()=>{if(y){const e=M(y)||O(y);L(e?"":"Please enter a valid email or phone number")}},required:!0}),r("p",{className:Ne,children:"Phone numbers must include a country code e.g. +1"}),z&&r(ze,{identifier:y,onMagicLink:async()=>{const{error:e}=await c.requestMagicLink();e?S("Failed to send magic link."):o(me,{state:{identifier:y}})},onEmailOtp:async()=>{const{error:e}=await c.requestLoginEmailOtp();e?S("Failed to send email code."):o(se,{state:{flow:"login"}})},onPhoneOtp:async()=>{const{error:e}=await c.requestLoginPhoneOtp();e?S("Failed to send OTP."):o(ie,{state:{flow:"login"}})},onPasskeyRetry:d?t:void 0,loginMethods:G}),z&&e("div",{className:Le,children:[r("button",{type:"button",className:Ae,onClick:()=>o(ue),children:"Use an authenticator app"}),f.recoveryCodes&&r("button",{type:"button",className:Ae,onClick:()=>o(_e),children:"Use a recovery code"}),f.accountRecovery&&r("button",{type:"button",className:Ae,onClick:()=>o(ge),children:"Can't sign in? Recover your account"})]}),A&&r("p",{className:we,children:A})]}),"register"===w&&e("div",{className:be,children:[r("label",{htmlFor:"email",className:ke,children:"Email Address"}),r("input",{id:"email",type:"email",value:b,onChange:e=>{const r=e.target.value;k(r)},autoComplete:"off",className:xe,onBlur:()=>{if(b){const e=M(b);q(e?"":"Please enter a valid email")}},required:!0}),T&&r("p",{className:we,children:T})]}),r("button",{type:"submit",className:Pe,disabled:!E(),"aria-describedby":"seamless-submit-hint",children:"login"===w?"Login":"Register"}),r("p",{id:"seamless-submit-hint",role:"status",className:Ce,children:"login"===w?y?E()?"Ready to continue.":"This does not look like a complete email or phone number yet.":"Enter your email or phone number to continue.":b?E()?"Ready to continue.":"This does not look like a complete email address yet.":"Enter your email address to continue."}),C&&r("p",{className:we,children:C}),r("button",{type:"button",onClick:()=>P("login"===w?"register":"login"),className:Se,children:"login"===w?"Don't have an account? Create one":"Already have an account? Sign in"})]}),r(Fe,{})]})]})})};var Ue={container:"passKeyLogin-module__container___IUKxF",card:"passKeyLogin-module__card___2sKM1",title:"passKeyLogin-module__title___HZxvc",button:"passKeyLogin-module__button___FvR4I"};d(".passKeyLogin-module__container___IUKxF{align-items:center;color:var(--seamless-text,#fff);display:flex;justify-content:center;padding:1rem}.passKeyLogin-module__card___2sKM1{background-color:var(--seamless-surface,#1f2937);border-radius:1rem;box-shadow:0 4px 20px var(--seamless-shadow,rgba(0,0,0,.4));display:flex;flex-direction:column;gap:1.5rem;max-width:400px;padding:2rem;width:100%}.passKeyLogin-module__title___HZxvc{color:var(--seamless-text,#fff);font-size:1.5rem;font-weight:600;text-align:center}.passKeyLogin-module__button___FvR4I{background-color:var(--seamless-accent,#2563eb);border:1px solid var(--seamless-accent,#3b82f6);border-radius:.5rem;color:var(--seamless-accent-contrast,#fff);cursor:pointer;font-weight:500;padding:.75rem 1rem;text-align:center;transition:background-color .2s ease;width:100%}.passKeyLogin-module__button___FvR4I:hover{background-color:var(--seamless-accent-hover,#1d4ed8)}@media (max-width:480px){.passKeyLogin-module__card___2sKM1{padding:1.25rem}.passKeyLogin-module__button___FvR4I{font-size:1rem}}");const Ee=()=>{const a=n(),{handlePasskeyLogin:o}=m(),[i,s]=x("");return r("div",{className:Ue.container,children:e("div",{className:Ue.card,children:[r("h2",{className:Ue.title,children:"Login with Passkey"}),r("button",{onClick:async()=>{s("");const{error:e}=await o();e?s("Passkey sign-in could not be completed. Try another sign-in method."):a("/")},className:Ue.button,children:"Use Passkey"}),i&&r("p",{className:Ue.error,children:i})]})})};var De="registerPasskey-module__container___jqEh8",je="registerPasskey-module__card___MJAyC",Ve="registerPasskey-module__loading___Q4i1x",We="registerPasskey-module__spinner___V1nhd",Ye="registerPasskey-module__supported___ihTih",Ke="registerPasskey-module__title___vn2Qu",Xe="registerPasskey-module__description___AWmO-",Je="registerPasskey-module__button___D3b4B",Ze="registerPasskey-module__message___RiOw-",He="registerPasskey-module__success___HP5aX",Qe="registerPasskey-module__error___hGiqE",$e="registerPasskey-module__skip___1hDyU",er="registerPasskey-module__secondary___bnOB4";d(".registerPasskey-module__container___jqEh8{align-items:center;color:var(--seamless-text,#fff);display:flex;justify-content:center;padding:1rem}.registerPasskey-module__card___MJAyC{background-color:var(--seamless-surface,#1f2937);border-radius:1rem;box-shadow:0 4px 20px var(--seamless-shadow,rgba(0,0,0,.4));max-width:400px;padding:1.5rem;width:100%}.registerPasskey-module__loading___Q4i1x{align-items:center;background-color:var(--seamless-surface,#f9fafb);border-radius:.75rem;box-shadow:0 2px 8px var(--seamless-shadow,rgba(0,0,0,.1));color:var(--seamless-text,#374151);display:flex;font-weight:500;gap:.75rem;justify-content:center;padding:1.5rem}.registerPasskey-module__spinner___V1nhd{animation:registerPasskey-module__spin___oYcsC 1s linear infinite;border-bottom:2px solid var(--seamless-accent,#3b82f6);border-left:2px solid transparent;border-radius:9999px;border-right:2px solid transparent;border-top:2px solid var(--seamless-accent,#3b82f6);height:1.5rem;width:1.5rem}@keyframes registerPasskey-module__spin___oYcsC{to{transform:rotate(1turn)}}.registerPasskey-module__supported___ihTih{background-color:var(--seamless-surface,#ecfdf5);border-radius:.75rem;box-shadow:0 2px 12px var(--seamless-shadow,rgba(0,0,0,.1));color:var(--seamless-text,#065f46);padding:1.25rem}.registerPasskey-module__title___vn2Qu{font-size:1.125rem;font-weight:600;margin-bottom:.5rem}.registerPasskey-module__description___AWmO-{margin-bottom:1rem}.registerPasskey-module__button___D3b4B{background-color:var(--seamless-accent,#059669);border:none;border-radius:.5rem;color:var(--seamless-accent-contrast,#fff);cursor:pointer;font-weight:500;padding:.75rem 1rem;transition:background-color .2s ease;width:100%}.registerPasskey-module__button___D3b4B:hover{background-color:var(--seamless-accent-hover,#047857)}.registerPasskey-module__message___RiOw-{font-size:.875rem;margin-top:1rem}.registerPasskey-module__success___HP5aX{color:var(--seamless-success,#6ee7b7)}.registerPasskey-module__error___hGiqE{color:var(--seamless-danger,#f87171)}.registerPasskey-module__skip___1hDyU{background:none;border:none;color:var(--seamless-accent-soft,#60a5fa);cursor:pointer;font-size:.875rem;margin-top:1.5rem;text-align:center;width:100%}.registerPasskey-module__skip___1hDyU:disabled{cursor:default;opacity:.6}.registerPasskey-module__secondary___bnOB4{background:none;border:1px solid var(--seamless-accent,#059669);border-radius:.5rem;color:var(--seamless-accent,#059669);cursor:pointer;font-weight:500;margin-top:.75rem;padding:.75rem 1rem;transition:background-color .2s ease;width:100%}.registerPasskey-module__secondary___bnOB4:hover:not(:disabled){background-color:var(--seamless-accent-muted,rgba(5,150,105,.1))}.registerPasskey-module__secondary___bnOB4:disabled{cursor:default;opacity:.6}");const rr=()=>{const{refreshSession:a,recoverySession:o}=m(),s=_(),{passkeySupported:t,loading:l}=u(),{loginMethods:c,loading:d}=h(),g=n(),p=q(i().state?.returnTo),[f,y]=x("idle"),[v,b]=x(""),k=!o&&A(c),N=()=>g(de,{state:{returnTo:p}}),w=async()=>{await a(),g(p)},P=async e=>{y("loading");const{error:r}=await L({client:s,refreshSession:a},e);if(r)return y("error"),void b(r);y("success"),b("Passkey registered successfully."),g(he,{state:{returnTo:p}})};return r("div",{className:De,children:r("div",{className:je,children:e("div",l||d?{className:Ve,children:[r("div",{className:We}),r("span",{children:"Checking for Passkey Support..."})]}:t?{className:Ye,children:[r("h2",{className:Ke,children:o?"Add a New Passkey":"Secure Your Account with a Passkey"}),r("p",{className:Xe,children:o?"You are signed in to recover your account. Add a new passkey to finish, and you will be able to use it to sign in from now on.":"Your device supports passkeys! Register one to skip passwords forever."}),r("button",{onClick:()=>P(),disabled:"loading"===f,className:Je,children:"loading"===f?"Registering...":"Register Passkey"}),r("button",{type:"button",onClick:()=>P("cross-platform"),disabled:"loading"===f,className:er,children:"Use a security key instead"}),o&&r("button",{type:"button",onClick:N,disabled:"loading"===f,className:er,children:"Use an authenticator app"}),v&&r("p",{className:`${Ze} ${"success"===f?He:Qe}`,children:v}),k&&r("button",{type:"button",onClick:w,disabled:"loading"===f,className:$e,children:"Skip for now"})]}:{className:Ye,children:[r("h2",{className:Ke,children:"Passkeys are not available here"}),r("p",{className:Xe,children:o?"This device does not support passkeys. Set up an authenticator app to finish recovering your account, or try again from a device that supports passkeys.":k?"This device does not support passkeys. You can continue without one and add a passkey later from a device that does.":"This device does not support passkeys, and this application requires one to sign in. Try again from a device or browser that supports them."}),k&&r("button",{type:"button",onClick:w,className:Je,children:"Continue"}),(o||k)&&r("button",{type:"button",onClick:N,className:k?er:Je,children:"Use an authenticator app"})]})})})};var ar="verifyOTP-module__container___wgoDE",or="verifyOTP-module__card___3cs2p",nr="verifyOTP-module__title___fZ-1d",ir="verifyOTP-module__subtitle___dGSu3",sr="verifyOTP-module__error___GEtlG",tr="verifyOTP-module__success___46TjG",lr="verifyOTP-module__form___jiGG-",cr="verifyOTP-module__label___Zq5Mi",dr="verifyOTP-module__timer___smq-a",mr="verifyOTP-module__resend___PlmkG",_r="verifyOTP-module__button___8pIuO",ur="verifyOTP-module__toggle___wbzVa";d(".verifyOTP-module__container___wgoDE{align-items:center;color:var(--seamless-text,#fff);display:flex;justify-content:center;padding:1rem}.verifyOTP-module__card___3cs2p{background-color:var(--seamless-surface,#1f2937);border-radius:.5rem;box-shadow:0 0 10px var(--seamless-shadow,rgba(0,0,0,.3));max-width:28rem;padding:1.5rem;width:100%}.verifyOTP-module__title___fZ-1d{color:var(--seamless-text,#fff);font-size:1.5rem;font-weight:700;margin-bottom:1rem;text-align:center}.verifyOTP-module__subtitle___dGSu3{color:var(--seamless-text-muted,#9ca3af);font-size:.875rem;margin-bottom:1.5rem;text-align:center}.verifyOTP-module__error___GEtlG{color:var(--seamless-danger,#f87171);margin-bottom:1rem;text-align:center}.verifyOTP-module__success___46TjG{color:var(--seamless-success,#34d399);margin-bottom:.75rem;text-align:center}.verifyOTP-module__form___jiGG-{display:flex;flex-direction:column;gap:1rem}.verifyOTP-module__label___Zq5Mi{color:var(--seamless-text-muted,#d1d5db);display:block;font-size:.875rem;margin-bottom:.25rem}.verifyOTP-module__timer___smq-a{color:var(--seamless-warning,#facc15);font-size:.875rem}.verifyOTP-module__input___yqIXM{background-color:var(--seamless-surface-raised,#374151);border:1px solid var(--seamless-border,#4b5563);border-radius:.375rem;color:var(--seamless-text,#fff);outline:none;padding:.5rem;width:100%}.verifyOTP-module__input___yqIXM:focus{box-shadow:0 0 0 2px var(--seamless-accent,#3b82f6)}.verifyOTP-module__resend___PlmkG{background:none;border:none;color:var(--seamless-accent-soft,#60a5fa);cursor:pointer;font-size:.75rem;margin-top:.25rem;text-decoration:underline}.verifyOTP-module__resend___PlmkG:hover{color:var(--seamless-accent,#3b82f6)}.verifyOTP-module__button___8pIuO{background-color:var(--seamless-accent,#2563eb);border:none;border-radius:.375rem;color:var(--seamless-accent-contrast,#fff);cursor:pointer;padding:.5rem;transition:background-color .2s;width:100%}.verifyOTP-module__button___8pIuO:hover{background-color:var(--seamless-accent-hover,#1d4ed8)}.verifyOTP-module__toggle___wbzVa{background:none;border:none;color:var(--seamless-accent-soft,#60a5fa);cursor:pointer;font-size:.875rem;margin-top:1.5rem;text-align:center;width:100%}");const hr=()=>{const a=n(),o=i(),{refreshSession:s}=m(),t="login"===o.state?.flow,[l,c]=x(""),[d,u]=x(null),[h,g]=x(""),[f,y]=x(!1),[v,b]=x(""),[k,w]=x(z),P=_(),C=async()=>{if(d)return;const{next:e,error:r}=await U({client:P,refreshSession:s},{channel:"phone",flow:t?"login":"register",code:l});if(null===r)return"verify_email"===e?(u(!0),void a(se)):void a("/");g(r)},S=async()=>{b(""),await(async()=>{g("");const{error:e}=await E(P,"phone",t?"login":"register");e?g(D("phone")):b("Verification SMS has been resent.")})(),b("Verification SMS has been resent.")};return N(()=>{const e=setInterval(()=>{w(e=>e>0?e-1:0)},1e3);return()=>clearInterval(e)},[]),r("div",{className:ar,children:e("div",{className:or,children:[r("h2",{className:nr,children:"Verify Your Phone Number"}),r("p",{className:ir,children:"Enter the code sent to your phone number."}),h&&r("p",{className:sr,children:h}),v&&r("p",{className:tr,children:v}),e("form",{onSubmit:async e=>{if(e.preventDefault(),g(""),l.length===G){y(!0);try{await C()}catch{g("Unexpected error occurred.")}finally{y(!1)}}else g("Please enter a valid code.")},className:lr,children:[e("div",{children:[e("label",{htmlFor:"phoneCode",className:cr,children:["Phone Verification Code ",(T=d,!0===T?r("span",{className:"text-green-400 ml-2",children:"✅"}):!1===T?r("span",{className:"text-red-400 ml-2",children:"❌"}):null)," -"," ",e("span",{className:dr,children:["Code expires in: ",F(k)]})]}),r(p,{length:6,value:l,onChange:c}),r("button",{type:"button",onClick:()=>S(),className:mr,children:"Resend code to phone"})]}),r("button",{type:"submit",className:_r,children:f?"Verifying...":"Verify & Continue"}),r("button",{type:"button",onClick:()=>a("/login"),className:ur,children:"Back to login"})]})]})});var T},gr=()=>{const a=n(),o=i(),{refreshSession:s}=m(),t=_(),{passkeySupported:l}=u(),c="login"===o.state?.flow,[d,h]=x(!1),[g,f]=x(""),[y,v]=x(z),[b,k]=x(""),[w,P]=x("");return N(()=>{const e=setInterval(()=>{v(e=>e>0?e-1:0)},1e3);return()=>clearInterval(e)},[]),r("div",{className:ar,children:e("div",{className:or,children:[r("h2",{className:nr,children:"Verify Your Email"}),r("p",{className:ir,children:"We sent you a verification email. Enter the code below."}),b&&r("p",{className:sr,children:b}),w&&r("p",{className:tr,children:w}),e("form",{onSubmit:async e=>{if(e.preventDefault(),k(""),g.length===G){h(!0);try{const{next:e,error:r}=await U({client:t,refreshSession:s},{channel:"email",flow:c?"login":"register",code:g,passkeySupported:l});if(null!==r)return void k(r);a("register_passkey"===e?ce:"/")}catch{console.error("Email OTP verification failed."),k("Verification failed.")}finally{h(!1)}}else k("Please enter a valid code.")},className:lr,children:[e("div",{children:[e("label",{htmlFor:"emailCode",className:cr,children:["Email Verification Code",e("span",{className:dr,children:[" ","— Code expires in ",F(y)]})]}),r(p,{length:6,value:g,onChange:f,inputMode:"text"}),r("button",{type:"button",onClick:async()=>{k(""),P("");const{error:e}=await E(t,"email",c?"login":"register");e?k(D("email")):P("Verification email has been resent.")},className:mr,children:"Resend code to email"})]}),r("button",{type:"submit",className:_r,disabled:d,children:d?"Verifying...":"Verify & Continue"}),r("button",{type:"button",onClick:()=>a("/login"),className:ur,children:"Back to login"})]})]})})};var pr="verifyMagiclink-module__container___qrSXf",fr="verifyMagiclink-module__card___niKgr",yr="verifyMagiclink-module__title___SumxD",vr="verifyMagiclink-module__verificationContent___NdsS0",br="verifyMagiclink-module__spinner___lnW1k",kr="verifyMagiclink-module__successIcon___XjFEM",xr="verifyMagiclink-module__checkIcon___I0JOP",Nr="verifyMagiclink-module__prompt___tvPn4",wr="verifyMagiclink-module__helperText___ggTZw",Pr="verifyMagiclink-module__actions___6Jf29",Cr="verifyMagiclink-module__primaryButton___8DcTo",Sr="verifyMagiclink-module__secondaryButton___8n-GU",Tr="verifyMagiclink-module__error___tfBn0",Mr="verifyMagiclink-module__successText___lO5Qq";d(".verifyMagiclink-module__container___qrSXf{align-items:center;color:var(--seamless-text,#fff);display:flex;justify-content:center;padding:1rem}.verifyMagiclink-module__card___niKgr{background-color:var(--seamless-surface,#1f2937);border-radius:.5rem;box-shadow:0 0 10px var(--seamless-shadow,rgba(0,0,0,.3));max-width:28rem;padding:1.5rem;width:100%}.verifyMagiclink-module__title___SumxD{color:var(--seamless-text,#fff);font-size:1.5rem;font-weight:700;margin-bottom:1rem;text-align:center}.verifyMagiclink-module__verificationContent___NdsS0{align-items:center;display:flex;flex-direction:column;gap:14px;margin:20px 0}.verifyMagiclink-module__spinner___lnW1k{animation:verifyMagiclink-module__spin___2lGzj .9s linear infinite;border:3px solid var(--seamless-border,hsla(0,0%,100%,.15));border-radius:50%;border-top-color:var(--seamless-accent,#60a5fa);height:28px;width:28px}.verifyMagiclink-module__successIcon___XjFEM{align-items:center;background:rgba(16,185,129,.15);border-radius:50%;display:flex;height:36px;justify-content:center;width:36px}.verifyMagiclink-module__checkIcon___I0JOP{animation:verifyMagiclink-module__checkPop___-3qJu .25s ease-out;color:var(--seamless-success,#34d399);height:22px;width:22px}.verifyMagiclink-module__prompt___tvPn4{font-weight:600;line-height:1.4;text-align:center}.verifyMagiclink-module__helperText___ggTZw{color:var(--seamless-text-muted,#9ca3af);font-size:.875rem;line-height:1.4;text-align:center}.verifyMagiclink-module__actions___6Jf29{display:flex;flex-direction:column;gap:.6rem;width:100%}.verifyMagiclink-module__primaryButton___8DcTo{background-color:var(--seamless-accent,#2563eb);border:none;border-radius:.375rem;color:var(--seamless-accent-contrast,#fff);cursor:pointer;font:inherit;font-weight:500;padding:.65rem;width:100%}.verifyMagiclink-module__primaryButton___8DcTo:hover:not(:disabled){background-color:var(--seamless-accent-hover,#1d4ed8)}.verifyMagiclink-module__secondaryButton___8n-GU{background:transparent;border:1px solid var(--seamless-border,#374151);border-radius:.375rem;color:var(--seamless-text,#fff);cursor:pointer;font:inherit;padding:.65rem;width:100%}.verifyMagiclink-module__secondaryButton___8n-GU:hover:not(:disabled){background:var(--seamless-surface-hover,#1f2937)}.verifyMagiclink-module__primaryButton___8DcTo:disabled,.verifyMagiclink-module__secondaryButton___8n-GU:disabled{cursor:not-allowed;opacity:.6}.verifyMagiclink-module__error___tfBn0{color:var(--seamless-danger,#f87171);text-align:center}.verifyMagiclink-module__successText___lO5Qq{color:var(--seamless-success,#34d399);font-size:.9rem}@keyframes verifyMagiclink-module__checkPop___-3qJu{0%{opacity:0;transform:scale(.6)}80%{transform:scale(1.15)}to{opacity:1;transform:scale(1)}}@keyframes verifyMagiclink-module__spin___2lGzj{to{transform:rotate(1turn)}}");const Or=()=>{const[o,i]=s(),t=n(),[l]=x(()=>o.get("token")),[c,d]=x(""),[u,h]=x(null),[g,p]=x(null),[f,y]=x("pending"),[v,b]=x(""),k=_(),{refreshSession:P}=m(),C=w(null);N(()=>{o.has("token")&&i(new URLSearchParams,{replace:!0})},[o,i]),N(()=>{let e=!0,r=null;return(async()=>{if(!l)return e&&d("Missing token for verification."),void console.error("No magic-link token found.");C.current?.token!==l&&(C.current={token:l,result:k.verifyMagicLink(l)});const{error:a}=await C.current.result;if(!e)return;if(a){const e=V(a);return e?void p(e):(console.error("Failed to verify token"),void d("Failed to verify token"))}const o=await W({client:k,refreshSession:P});e&&(h(o),"elsewhere"!==o&&(r=setTimeout(()=>{e&&t("/")},900)))})(),()=>{e=!1,r&&clearTimeout(r)}},[l,k,t,P]);return r("div",g?{className:pr,children:e("div",{className:fr,children:[r("h1",{className:yr,children:"Confirm this sign-in"}),e("div",{className:vr,children:[("pending"===f||"confirming"===f)&&e(a,{children:[r("p",{className:Nr,children:j(g)}),r("p",{className:wr,children:"This link was opened on a different device from the one that asked for it. Only continue if you made that request."}),e("div",{className:Pr,children:[r("button",{type:"button",className:Cr,disabled:"confirming"===f,onClick:()=>{(async()=>{if(!l||"confirming"===f)return;y("confirming"),b("");const{error:e}=await Y({client:k,token:l});if(e)return y("pending"),void b("We could not confirm this sign-in. The link may have expired or already been used.");y("confirmed")})()},children:"Yes, sign in that device"}),r("button",{type:"button",className:Sr,disabled:"confirming"===f,onClick:()=>y("declined"),children:"No, this wasn't me"})]}),v&&r("p",{className:Tr,role:"alert",children:v})]}),"confirmed"===f&&r("p",{className:Mr,role:"status",children:"Sign-in approved. You can return to your other device to continue."}),"declined"===f&&r("p",{className:wr,role:"status",children:"No one has been signed in. You can ignore the email and close this page."})]})]})}:{className:pr,children:e("div",{className:fr,children:[r("h1",{className:yr,children:"Verifying your login"}),e("div",{className:vr,children:[!u&&!c&&r("div",{className:br}),u&&r("div",{className:kr,children:r("svg",{viewBox:"0 0 24 24",className:xr,fill:"none",stroke:"currentColor",strokeWidth:"2",children:r("path",{d:"M5 13l4 4L19 7"})})}),!u&&!c&&r("p",{className:wr,children:"Please wait while we securely verify your sign-in link."}),"signed-in"===u&&r("p",{className:Mr,children:"Login verified. Redirecting…"}),"elsewhere"===u&&r("p",{className:Mr,children:"Login verified. Return to the device where you requested this link to continue."}),c&&r("p",{className:Tr,children:c})]})]})})},Br=()=>{const{finishOAuthLogin:o}=m(),i=n(),[t,l]=s(),[c,d]=x(""),_=w(!1);return N(()=>{if(_.current)return;_.current=!0;const e=new URLSearchParams(t);""!==e.toString()&&l(new URLSearchParams,{replace:!0}),K({finishOAuthLogin:o},e,window.location.origin).then(e=>{"error"!==e.kind?"enroll_passkey"!==e.kind?i(e.destination):i(ce,{state:{returnTo:e.returnTo}}):d(e.message)})},[o,i,t,l]),e("div",{className:pr,children:[r("h2",{className:yr,children:c?"Sign-in failed":"Completing sign-in..."}),c&&e(a,{children:[r("p",{children:c}),r("button",{type:"button",onClick:()=>i("/login"),children:"Back to login"})]})]})},Ir=()=>{const a=n(),{redeemRecoveryCode:o}=m(),[i,s]=x(""),[t,l]=x(""),[c,d]=x(!1);return r("div",{className:f.container,children:e("div",{className:f.card,children:[r("h2",{className:f.title,children:"Use a recovery code"}),r("p",{className:f.description,children:"Enter one of the recovery codes you saved. Once you are in, you will add a new passkey."}),e("form",{onSubmit:async e=>{e.preventDefault(),l(""),d(!0);const{error:r}=await o(i.trim());d(!1),r?l(X(r,"We could not sign you in with that code. Go back and sign in again, then try the code once more.")):a(ce,{replace:!0})},className:f.form,children:[e("label",{htmlFor:"recoveryCode",className:f.label,children:["Recovery code",r("input",{id:"recoveryCode",className:f.input,value:i,onChange:e=>s(e.target.value),autoComplete:"one-time-code",autoCapitalize:"characters",spellCheck:!1,placeholder:"XXXXX-XXXXX",required:!0})]}),t&&r("p",{role:"alert",className:f.error,children:t}),r("button",{type:"submit",className:f.button,disabled:c||""===i.trim(),children:c?"Checking...":"Sign in"}),r("button",{type:"button",className:f.link,onClick:()=>a(oe),children:"Back to sign in"})]})]})})},Rr=()=>{const a=n(),o=_(),s=y(),t=q(i().state?.returnTo),[l,c]=x("loading"),[d,m]=x([]),[u,h]=x(""),[g,p]=x(!1),[b,k]=x(!1),P=w(!1),C=()=>a(t,{replace:!0}),S=async()=>{p(!0),h("");const e=await J({client:o,verifyStepUp:s.verifyStepUp});return p(!1),"error"===e.kind?(s.cancelled()||h(e.message),!1):(m(e.codes.codes),c("show"),!0)};return N(()=>{P.current||(P.current=!0,(async()=>{const{data:e,error:r}=await o.getRecoveryCodeStatus();if(!(r||!e.enabled||e.remaining>0))return e.total>0?(k(!0),void c("offer")):void(await S()||c("offer"));C()})())},[]),r("div",{className:f.container,children:e("div",{className:f.card,children:[r("h2",{className:f.title,children:"Save your recovery codes"}),"loading"===l&&r("p",{role:"status",className:f.loading,children:"Preparing your recovery codes..."}),"show"===l&&r(v,{codes:d,onDone:C}),s.prompt,"offer"===l&&e("div",{className:f.form,children:[r("p",{className:f.description,children:b?"You have used all of your recovery codes. Generate a new set so you can still get in if you lose your passkeys.":"Recovery codes let you sign in if you lose your passkeys."}),r("button",{type:"button",className:f.button,onClick:()=>{S()},disabled:g,children:g?"Generating...":"Generate recovery codes"}),r("button",{type:"button",className:f.link,onClick:C,children:"Skip for now"})]}),u&&r("p",{role:"alert",className:f.error,children:u})]})})},qr={email:"email",phone:"text message"},Ar=()=>{const o=n(),i=_(),{completeAccountRecovery:s}=m(),[t,l]=x("channel"),[c,d]=x("email"),[u,h]=x(""),[g,y]=x(null),[v,b]=x(""),[k,N]=x(!1),w=(e,r)=>{b(!Z(e)&&H(e)?"Your sign-in timed out. Sign in again and choose the same recovery method to continue.":X(e,r))},P=async e=>{b(""),N(!0);try{await e()}finally{N(!1)}},C=e=>P(async()=>{d(e);const{error:r}=await i.startAccountRecovery(e);r?w(r,"We could not send a recovery code. Please try again."):(h(""),l("code"))});return r("div",{className:f.container,children:e("div",{className:f.card,children:[r("h2",{className:f.title,children:"Recover your account"}),"channel"===t&&e("div",{className:f.form,children:[r("p",{className:f.description,children:"We will send a code to the email address or phone number on your account. For your security, recovery finishes only after a waiting period, and everyone on the account is told so they can stop it. If you started recovery before, choose the same method to pick it back up."}),e("div",{className:f.choices,children:[r("button",{type:"button",className:f.secondary,onClick:()=>{C("email")},disabled:k,children:"Send a code by email"}),r("button",{type:"button",className:f.secondary,onClick:()=>{C("phone")},disabled:k,children:"Send a code by text message"})]})]}),"code"===t&&e("form",{onSubmit:e=>(e.preventDefault(),P(async()=>{const{data:e,error:r}=await i.verifyAccountRecovery(u);r?w(r,"That code did not work. Check it and try again."):(y(e),l("status"))})),className:f.form,children:[e("p",{className:f.description,children:["If your account has a verified ",qr[c]," on file, we sent it a six-digit code. It expires in ten minutes."]}),r("label",{htmlFor:"recoveryOtp",className:f.label,children:"Recovery code"}),r(p,{length:6,value:u,onChange:h,name:"recoveryOtp"}),r("button",{type:"submit",className:f.button,disabled:k||6!==u.length,children:k?"Verifying...":"Verify"}),r("button",{type:"button",className:f.link,onClick:()=>l("channel"),children:"Use a different method"})]}),"status"===t&&g&&e("div",{className:f.form,children:["pending"===g.state&&e(a,{children:[e("p",{className:f.description,children:["Your recovery request is open. You can finish it after"," ",r("strong",{children:(S=g.completesAt,new Date(S).toLocaleString())}),". We told every address on your account, and anyone with access to them can cancel it."]}),r("p",{className:f.description,children:"Come back then, sign in again, and choose the same method to finish."}),r("button",{type:"button",className:f.secondary,onClick:()=>{P(async()=>{const{data:e,error:r}=await i.getAccountRecoveryStatus();r?w(r,"We could not check your recovery request."):y(e)})},disabled:k,children:"Check again"})]}),"ready"===g.state&&e(a,{children:[r("p",{className:f.description,children:"The waiting period is over. Finishing signs out every session on your account, then you will add a new passkey."}),r("button",{type:"button",className:f.button,onClick:()=>{P(async()=>{const{error:e}=await s();e?w(e,"We could not finish recovering your account."):o(ce,{replace:!0})})},disabled:k,children:k?"Finishing...":"Finish recovery"})]}),"cancelled"===g.state&&r("p",{className:f.description,children:"This recovery request was cancelled. If that was not you, start again."}),"completed"===g.state&&r("p",{className:f.description,children:"This recovery request has already been completed."})]}),v&&r("p",{role:"alert",className:f.error,children:v}),r("button",{type:"button",className:f.link,onClick:()=>o(oe),children:"Back to sign in"})]})});var S},Lr=()=>{const a=n(),o=_(),{refreshSession:i}=m();return r("div",{className:f.container,children:e("div",{className:f.card,children:[r("h2",{className:f.title,children:"Use an authenticator app"}),r("p",{className:f.description,children:"Enter the 6-digit code your authenticator app shows for this account."}),r(b,{submitLabel:"Sign in",onSubmit:async e=>{const{error:r}=await Q({client:o,refreshSession:i},e);return r||(a("/"),null)},children:r("button",{type:"button",className:f.link,onClick:()=>a(oe),children:"Back to sign in"})})]})})},zr=()=>{const o=n(),{recoverySession:s}=m(),{passkeySupported:t}=u(),l=q(i().state?.returnTo),[c,d]=x(!1);return r("div",{className:f.container,children:r("div",{className:f.card,children:c?e("div",{className:f.form,children:[r("h2",{className:f.title,children:"Authenticator app added"}),r("p",{role:"status",className:f.success,children:"Your authenticator app is set up. Use a code from it to sign in or to confirm it is you."}),r("button",{type:"button",className:f.button,onClick:()=>o(he,{replace:!0,state:{returnTo:l}}),children:"Continue"})]}):e(a,{children:[r("h2",{className:f.title,children:"Set up an authenticator app"}),s&&r("p",{className:f.description,children:"You are signed in to recover your account. Add an authenticator app to finish."}),r(k,{onEnrolled:()=>d(!0),children:t&&r("button",{type:"button",className:f.link,onClick:()=>o(ce,{state:{returnTo:l}}),children:"Use a passkey instead"})})]})})})},Fr=()=>{const a=n(),o=i(),s=_(),[t,l]=x(null),c=w(!1);return N(()=>{if(c.current)return;c.current=!0;const e=$(o.hash);o.hash&&a({pathname:o.pathname,search:o.search},{replace:!0,state:o.state}),ee(s,e).then(l)},[]),r("div",{className:f.container,children:e("div",{className:f.card,children:[r("h2",{className:f.title,children:"Cancel account recovery"}),!t&&r("p",{role:"status",className:f.loading,children:"Cancelling the recovery request..."}),"cancelled"===t?.kind&&r("div",{role:"status",children:r("p",{className:f.description,children:"The recovery request this link was sent for is cancelled, if it was still open, and no one can finish recovering your account with it. If you did not ask to recover your account, someone may know your email address or phone number. Sign in and add a second passkey to keep your account safe."})}),"error"===t?.kind&&r("p",{role:"alert",className:f.error,children:t.message}),r("button",{type:"button",className:f.link,onClick:()=>a(oe),children:"Go to sign in"})]})})};var Gr="magiclink-module__container___45zcA",Ur="magiclink-module__card___Au9oN",Er="magiclink-module__iconWrapper___k5ndr",Dr="magiclink-module__mailIcon___Pwb7q",jr="magiclink-module__iconRing___bdLvf",Vr="magiclink-module__heading___b9cre",Wr="magiclink-module__message___kiVFj",Yr="magiclink-module__identifier___JtcFM",Kr="magiclink-module__helperText___7Mlfh",Xr="magiclink-module__actions___64I-3",Jr="magiclink-module__secondaryButton___BntAI",Zr="magiclink-module__cooldown___Ib4rm",Hr="magiclink-module__linkButton___maJiv";d(".magiclink-module__container___45zcA{align-items:center;color:var(--seamless-text,#fff);display:flex;justify-content:center}.magiclink-module__card___Au9oN{background-color:var(--seamless-surface,#1f2937);border-radius:.75rem;box-shadow:0 10px 25px var(--seamless-shadow,rgba(0,0,0,.25));max-width:420px;padding:2.5rem 2rem;text-align:center;width:100%}.magiclink-module__iconWrapper___k5ndr{display:flex;justify-content:center;margin-bottom:1.25rem;position:relative}.magiclink-module__mailIcon___Pwb7q{color:var(--seamless-accent-soft,#a5b4fc);height:38px;width:38px;z-index:2}.magiclink-module__iconRing___bdLvf{animation:magiclink-module__pulse___YGm-I 2s infinite;background:rgba(99,102,241,.15);border-radius:50%;height:72px;position:absolute;width:72px}@keyframes magiclink-module__pulse___YGm-I{0%{opacity:.8;transform:scale(.6)}70%{opacity:0;transform:scale(1.4)}to{opacity:0}}.magiclink-module__heading___b9cre{font-size:1.55rem;font-weight:600;margin-bottom:.75rem}.magiclink-module__message___kiVFj{color:var(--seamless-text-muted,#d1d5db);font-size:.95rem;line-height:1.4;margin-bottom:1rem}.magiclink-module__identifier___JtcFM{background:var(--seamless-surface-raised,hsla(0,0%,100%,.05));border-radius:6px;display:inline-block;font-size:1rem;font-weight:600;margin-bottom:1rem;padding:.45rem .6rem}.magiclink-module__helperText___7Mlfh{color:var(--seamless-text-muted,#9ca3af);font-size:.85rem;line-height:1.4;margin-bottom:.6rem}.magiclink-module__actions___64I-3{display:flex;flex-direction:column;gap:.6rem;margin-top:1.6rem}.magiclink-module__secondaryButton___BntAI{background:var(--seamless-surface,#111827);border:1px solid var(--seamless-border,#374151);border-radius:8px;color:var(--seamless-text,#fff);cursor:pointer;font-weight:500;padding:.65rem}.magiclink-module__secondaryButton___BntAI:hover:not(:disabled){background:var(--seamless-surface-hover,#1f2937)}.magiclink-module__secondaryButton___BntAI:disabled{cursor:not-allowed;opacity:.5}.magiclink-module__cooldown___Ib4rm{color:var(--seamless-text-muted,#9ca3af);font-size:.8rem}.magiclink-module__linkButton___maJiv{background:none;border:none;color:var(--seamless-accent-soft,#a5b4fc);cursor:pointer;font-size:.85rem;margin-top:.4rem}.magiclink-module__linkButton___maJiv:hover{text-decoration:underline}");const Qr=()=>{const{refreshSession:a}=m(),o=n(),s=i(),t=_(),l=s.state?.identifier,[c,d]=x(re);N(()=>{const e=setInterval(()=>{d(e=>e>0?e-1:0)},1e3);return()=>clearInterval(e)},[]);return N(()=>ae({client:t,refreshSession:a,onSignedIn:()=>o("/")}),[t,o,a]),r("div",{className:Gr,children:e("div",{className:Ur,children:[e("div",{className:Er,children:[r("div",{className:jr}),e("svg",{className:Dr,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",children:[r("path",{d:"M4 6h16v12H4z"}),r("path",{d:"m4 6 8 6 8-6"})]})]}),r("h2",{className:Vr,children:"Check your email"}),r("p",{className:Wr,children:"If an account exists for this address, we sent a secure sign-in link."}),l&&r("div",{className:Yr,children:l}),r("p",{className:Kr,children:"Open the email and click the link to finish signing in."}),r("p",{className:Kr,children:"Didn’t receive anything? Check your spam folder or try creating a new account."}),e("div",{className:Xr,children:[r("button",{className:Jr,disabled:c>0,onClick:async()=>{c>0||(await t.requestMagicLink(),d(re))},children:"Resend link"}),c>0&&e("div",{className:Zr,children:["Available in ",c,"s"]}),r("button",{className:Hr,onClick:()=>o("/login"),children:"Change email or phone"})]})]})})},$r=()=>e(t,{children:[r(l,{path:oe,element:r(Ge,{})}),r(l,{path:ne,element:r(Ee,{})}),r(l,{path:ie,element:r(hr,{})}),r(l,{path:se,element:r(gr,{})}),r(l,{path:te,element:r(Or,{})}),r(l,{path:le,element:r(Br,{})}),r(l,{path:ce,element:r(rr,{})}),r(l,{path:de,element:r(zr,{})}),r(l,{path:me,element:r(Qr,{})}),r(l,{path:_e,element:r(Ir,{})}),r(l,{path:ue,element:r(Lr,{})}),r(l,{path:he,element:r(Rr,{})}),r(l,{path:ge,element:r(Ar,{})}),r(l,{path:pe,element:r(Fr,{})}),r(l,{path:"*",element:r(c,{to:oe,replace:!0})})]});export{$r as AuthRoutes};
|
|
3
3
|
//# sourceMappingURL=routes.js.map
|
package/dist/routes.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.js","sources":["../src/authRoutePaths.ts","../../../node_modules/style-inject/dist/style-inject.es.js","../src/components/AuthFallbackOptions.tsx","../src/components/OAuthProviderButtons.tsx","../src/views/Login.tsx","../src/views/PassKeyLogin.tsx","../src/views/PassKeyRegistration.tsx","../src/components/OtpInput.tsx","../src/views/PhoneRegistration.tsx","../src/views/EmailRegistration.tsx","../src/views/VerifyMagicLink.tsx","../src/views/OAuthCallback.tsx","../src/components/MagicLinkSent.tsx","../src/AuthRoutes.tsx"],"sourcesContent":[null,"function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n",null,null,null,null,null,null,null,null,null,null,null,null],"names":["authRoutePaths","styleInject","css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","AuthFallbackOptions","identifier","onMagicLink","onEmailOtp","onPhoneOtp","onPasskeyRetry","loginMethods","options","fallbackSignInOptions","emailOtp","Boolean","passkeyRetry","hasFallbackSignInOption","_jsxs","className","styles","children","_jsx","magicLink","onClick","phoneOtp","OAuthProviderButtons","listOAuthProviders","startOAuthLogin","finishOAuthLogin","ports","useAuth","callbackHref","useHref","OAUTH_CALLBACK_PATH","providers","setProviders","useState","error","setError","useEffect","active","then","data","length","map","provider","async","providerId","redirectUri","URL","window","location","origin","toString","startOAuthSignIn","actions","oauthRedirect","handleSelect","id","name","Login","navigate","useNavigate","hasSignedInBefore","login","handlePasskeyLogin","authClient","useAuthClient","passkeySupported","usePasskeySupport","configuredMethods","useLoginMethods","setIdentifier","email","setEmail","mode","setMode","formErrors","setFormErrors","emailError","setEmailError","identifierError","setIdentifierError","showFallbackOptions","setShowFallbackOptions","setLoginMethods","canSubmit","isValidEmail","isValidPhoneNumber","_Fragment","onSubmit","e","preventDefault","step","beginSignIn","kind","message","passkeyFailed","PASSKEY_SIGN_IN_FAILED","registerWithEmail","register","console","htmlFor","value","onChange","target","autoComplete","placeholder","onBlur","isValid","required","requestMagicLink","state","requestLoginEmailOtp","flow","requestLoginPhoneOtp","undefined","disabled","role","PassKeyLogin","runPasskeyLogin","container","card","title","passkeyError","button","PasskeyRegistration","refreshSession","loading","passkeySupportLoading","loginMethodsLoading","destination","safeReturnPath","useLocation","returnTo","status","setStatus","setMessage","canSkip","hasNonPasskeyLoginMethod","finishWithoutPasskey","registerPasskey","attachment","enrollPasskey","client","OtpInput","inputMode","inputs","useRef","values","split","concat","Array","fill","slice","handleBulkInput","index","input","chars","otpCharacters","newValueArr","forEach","char","i","join","current","Math","min","focus","onPaste","clipboardData","getData","el","maxLength","isOtpCharacter","newValue","handleChange","onKeyDown","key","handleKeyDown","PhoneRegistration","isLoginFlow","setPhoneOtp","phoneVerified","setPhoneVerified","setLoading","resendMsg","setResendMsg","phoneTimeLeft","setPhoneTimeLeft","OTP_LIFETIME_SECONDS","verifyPhoneOTP","next","verifyOtp","channel","code","handleResend","requestOtp","otpResendFailedMessage","onResendPhone","interval","setInterval","prev","clearInterval","OTP_LENGTH","verified","formatCountdown","EmailRegistration","setEmailOtp","emailTimeLeft","setEmailTimeLeft","VerifyMagicLink","searchParams","useSearchParams","token","get","outcome","setOutcome","confirmation","setConfirmation","decision","setDecision","confirmError","setConfirmError","verification","mounted","redirectTimeout","result","verifyMagicLink","held","getMagicLinkConfirmation","finishMagicLinkSignIn","setTimeout","verify","clearTimeout","magicLinkConfirmationPrompt","confirmMagicLinkSignIn","confirm","viewBox","stroke","strokeWidth","d","OAuthCallback","startedRef","completeOAuthCallback","MagicLinkSent","cooldown","setCooldown","MAGIC_LINK_RESEND_COOLDOWN_SECONDS","timer","c","watchMagicLink","onSignedIn","AuthRoutes","Routes","Route","path","element","Navigate","to","replace"],"mappings":";m/BAiBO,MAAMA,EACJ,SADIA,EAEG,iBAFHA,EAGK,oBAHLA,EAIK,oBAJLA,EAKM,oBALNA,EAMI,kBANJA,EAOM,oBAPNA,EAQI,mBCzBjB,SAASC,EAAYC,EAAKC,YACnBA,IAAiBA,EAAM,CAAA,GAC5B,IAAIC,EAAWD,EAAIC,SAEnB,GAAKF,GAA2B,oBAAbG,SAAnB,CAEA,IAAIC,EAAOD,SAASC,MAAQD,SAASE,qBAAqB,QAAQ,GAC9DC,EAAQH,SAASI,cAAc,SACnCD,EAAME,KAAO,WAEI,QAAbN,GACEE,EAAKK,WACPL,EAAKM,aAAaJ,EAAOF,EAAKK,YAKhCL,EAAKO,YAAYL,GAGfA,EAAMM,WACRN,EAAMM,WAAWC,QAAUb,EAE3BM,EAAMK,YAAYR,SAASW,eAAed,GAnBW,CAqBzD,q6ICDA,MAAMe,GAA0D,EAC9DC,aACAC,cACAC,aACAC,aACAC,iBACAC,mBAEA,MAAMC,EAAUC,EAAsBP,EAAYK,EAAc,CAC9DG,SAAUC,QAAQP,GAClBQ,aAAcD,QAAQL,KAGxB,OAAKO,EAAwBL,GAK3BM,EAAA,MAAA,CAAKC,UAAWC,GAAmBC,SAAA,CACjCC,EAAA,MAAA,CAAKH,UAAWC,GAAqBC,SAAA,4BAErCC,OAAGH,UAAWC,GAA0BC,SAAA,0CAExCH,SAAKC,UAAWC,GAAsBC,SAAA,CACnCT,EAAQW,WACPL,EAAA,SAAA,CACEpB,KAAK,SACLqB,UAAWC,GACXI,QAASjB,EAAWc,SA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0L,SACtD1L,EAAC0O,EAAK,CAACC,KAAM7Q,EAAgC8Q,QAAS5O,EAAC8L,SACvD9L,EAAC0O,GAAMC,KAAM7Q,EAA8B8Q,QAAS5O,EAAC6N,GAAa,CAAA,KAClE7N,EAAC0O,EAAK,CAACC,KAAM7Q,EAAgC8Q,QAAS5O,EAACyG,GAAmB,CAAA,KAC1EzG,EAAC0O,EAAK,CAACC,KAAM7Q,EAA8B8Q,QAAS5O,EAACgO,GAAa,CAAA,KAClEhO,EAAC0O,EAAK,CAACC,KAAK,IAAIC,QAAS5O,EAAC6O,GAASC,GAAIhR,EAAsBiR","x_google_ignoreList":[1]}
|
|
1
|
+
{"version":3,"file":"routes.js","sources":["../src/authRoutePaths.ts","../src/components/AuthFallbackOptions.tsx","../src/components/OAuthProviderButtons.tsx","../src/views/Login.tsx","../src/views/PassKeyLogin.tsx","../src/views/PassKeyRegistration.tsx","../src/views/PhoneRegistration.tsx","../src/views/EmailRegistration.tsx","../src/views/VerifyMagicLink.tsx","../src/views/OAuthCallback.tsx","../src/views/RecoveryCodeLogin.tsx","../src/views/RecoveryCodes.tsx","../src/views/AccountRecovery.tsx","../src/views/AuthenticatorCodeLogin.tsx","../src/views/AuthenticatorRegistration.tsx","../src/views/RecoveryCancel.tsx","../src/components/MagicLinkSent.tsx","../src/AuthRoutes.tsx"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"names":["authRoutePaths","AuthFallbackOptions","identifier","onMagicLink","onEmailOtp","onPhoneOtp","onPasskeyRetry","loginMethods","options","fallbackSignInOptions","emailOtp","Boolean","passkeyRetry","hasFallbackSignInOption","_jsxs","className","styles","children","_jsx","magicLink","type","onClick","phoneOtp","OAuthProviderButtons","listOAuthProviders","startOAuthLogin","finishOAuthLogin","ports","useAuth","callbackHref","useHref","OAUTH_CALLBACK_PATH","providers","setProviders","useState","error","setError","useEffect","active","then","data","length","map","provider","async","providerId","redirectUri","URL","window","location","origin","toString","startOAuthSignIn","actions","oauthRedirect","handleSelect","id","name","Login","navigate","useNavigate","hasSignedInBefore","login","handlePasskeyLogin","recoverySession","authClient","useAuthClient","passkeySupported","usePasskeySupport","configuredMethods","useLoginMethods","recoveryOptions","useRecoveryOptions","setIdentifier","email","setEmail","mode","setMode","formErrors","setFormErrors","emailError","setEmailError","identifierError","setIdentifierError","showFallbackOptions","setShowFallbackOptions","setLoginMethods","replace","canSubmit","isValidEmail","isValidPhoneNumber","_Fragment","onSubmit","e","preventDefault","step","beginSignIn","kind","message","passkeyFailed","PASSKEY_SIGN_IN_FAILED","registerWithEmail","register","console","htmlFor","value","onChange","target","autoComplete","placeholder","onBlur","isValid","required","requestMagicLink","state","requestLoginEmailOtp","flow","requestLoginPhoneOtp","undefined","recoveryCodes","accountRecovery","disabled","role","PassKeyLogin","runPasskeyLogin","container","card","title","passkeyError","button","PasskeyRegistration","refreshSession","loading","passkeySupportLoading","loginMethodsLoading","destination","safeReturnPath","useLocation","returnTo","status","setStatus","setMessage","canSkip","hasNonPasskeyLoginMethod","setUpAuthenticatorApp","finishWithoutPasskey","registerPasskey","attachment","enrollPasskey","client","PhoneRegistration","isLoginFlow","setPhoneOtp","phoneVerified","setPhoneVerified","setLoading","resendMsg","setResendMsg","phoneTimeLeft","setPhoneTimeLeft","OTP_LIFETIME_SECONDS","verifyPhoneOTP","next","verifyOtp","channel","code","handleResend","requestOtp","otpResendFailedMessage","onResendPhone","interval","setInterval","prev","clearInterval","OTP_LENGTH","verified","formatCountdown","OtpInput","EmailRegistration","setEmailOtp","emailTimeLeft","setEmailTimeLeft","inputMode","VerifyMagicLink","searchParams","setSearchParams","useSearchParams","token","get","outcome","setOutcome","confirmation","setConfirmation","decision","setDecision","confirmError","setConfirmError","verification","useRef","has","URLSearchParams","mounted","redirectTimeout","current","result","verifyMagicLink","held","getMagicLinkConfirmation","finishMagicLinkSignIn","setTimeout","verify","clearTimeout","magicLinkConfirmationPrompt","confirmMagicLinkSignIn","confirm","viewBox","fill","stroke","strokeWidth","d","OAuthCallback","startedRef","params","completeOAuthCallback","RecoveryCodeLogin","redeemRecoveryCode","setCode","description","event","redeemError","trim","recoveryErrorMessage","form","label","input","autoCapitalize","spellCheck","link","RecoveryCodes","stepUp","useStepUpPrompt","setStep","codes","setCodes","busy","setBusy","usedUp","setUsedUp","started","finish","generate","generateRecoveryCodesWithStepUp","verifyStepUp","cancelled","statusError","getRecoveryCodeStatus","enabled","remaining","total","RecoveryCodeList","onDone","prompt","CHANNEL_LABELS","phone","AccountRecovery","completeAccountRecovery","setChannel","failWith","failure","fallback","getRecoveryErrorCode","isUnauthenticated","run","task","start","chosen","startError","startAccountRecovery","choices","secondary","verifyError","verifyAccountRecovery","completesAt","Date","toLocaleString","getAccountRecoveryStatus","completeError","AuthenticatorCodeLogin","TotpCodeForm","submitLabel","signInWithTotp","AuthenticatorRegistration","enrolled","setEnrolled","success","TotpEnrollment","onEnrolled","RecoveryCancel","recoveryCancelTokenFromHash","hash","pathname","search","cancelRecoveryFromLink","MagicLinkSent","cooldown","setCooldown","MAGIC_LINK_RESEND_COOLDOWN_SECONDS","timer","c","watchMagicLink","onSignedIn","AuthRoutes","Routes","Route","path","element","Navigate","to"],"mappings":";wsCAmBO,MAAMA,GACJ,SADIA,GAEG,iBAFHA,GAGK,oBAHLA,GAIK,oBAJLA,GAKM,oBALNA,GAMI,kBANJA,GAOM,oBAPNA,GAQY,0BARZA,GASI,mBATJA,GAUG,iBAVHA,GAWQ,sBAXRA,GAYI,kBAZJA,GAaM,oBAbNA,GAcK,slJCTlB,MAAMC,GAA0D,EAC9DC,aACAC,cACAC,aACAC,aACAC,iBACAC,mBAEA,MAAMC,EAAUC,EAAsBP,EAAYK,EAAc,CAC9DG,SAAUC,QAAQP,GAClBQ,aAAcD,QAAQL,KAGxB,OAAKO,EAAwBL,GAK3BM,EAAA,MAAA,CAAKC,UAAWC,GAAmBC,SAAA,CACjCC,EAAA,MAAA,CAAKH,UAAWC,GAAqBC,SAAA,4BAErCC,OAAGH,U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,CAACC,KAAK,IAAIC,QAASzS,EAAC0S,EAAQ,CAACC,GAAI7T,GAAsBuF,SAAO"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Self-service recovery for a user with no passkey and no recovery codes. It
|
|
4
|
+
* cannot finish quietly: it waits out a delay, and every verified address on the
|
|
5
|
+
* account is told when it opens.
|
|
6
|
+
*/
|
|
7
|
+
declare const AccountRecovery: React.FC;
|
|
8
|
+
export default AccountRecovery;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Sets up an authenticator app, the alternative to a passkey on the enrollment
|
|
4
|
+
* step. For a recovery session it is the way forward on a device without
|
|
5
|
+
* passkeys. Afterwards it continues to recovery codes, as a passkey does.
|
|
6
|
+
*/
|
|
7
|
+
declare const AuthenticatorRegistration: React.FC;
|
|
8
|
+
export default AuthenticatorRegistration;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Where the link in a recovery notice lands. The token rides in the fragment so
|
|
4
|
+
* it never reaches a server log, and it is dropped from the address bar before
|
|
5
|
+
* anything else happens so it does not linger in history or a shared screenshot.
|
|
6
|
+
*/
|
|
7
|
+
declare const RecoveryCancel: React.FC;
|
|
8
|
+
export default RecoveryCancel;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Signs in with a recovery code, on the sign-in the login screen started. The
|
|
4
|
+
* session it issues can only enroll a passkey, so that is where it goes next.
|
|
5
|
+
*/
|
|
6
|
+
declare const RecoveryCodeLogin: React.FC;
|
|
7
|
+
export default RecoveryCodeLogin;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Offered straight after a passkey or authenticator app is enrolled. A user with no set gets one
|
|
4
|
+
* generated and shown here; a user whose codes are all spent is offered a new
|
|
5
|
+
* set. Anyone else, or an instance with recovery codes off, moves straight on.
|
|
6
|
+
*/
|
|
7
|
+
declare const RecoveryCodes: React.FC;
|
|
8
|
+
export default RecoveryCodes;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seamless-auth/react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.19.0",
|
|
4
4
|
"description": "A drop-in authentication solution for modern React applications.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -56,8 +56,8 @@
|
|
|
56
56
|
}
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@seamless-auth/client": "^0.
|
|
60
|
-
"@seamless-auth/types": "^0.
|
|
59
|
+
"@seamless-auth/client": "^0.8.0",
|
|
60
|
+
"@seamless-auth/types": "^0.33.0",
|
|
61
61
|
"@simplewebauthn/browser": "^13.1.0",
|
|
62
62
|
"libphonenumber-js": "^1.12.7"
|
|
63
63
|
},
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import{createContext as e,useContext as t,useMemo as s,useRef as r,useSyncExternalStore as i,useEffect as o,useState as a}from"react";import{createBrowserOAuthRedirect as n,createBrowserPasskeyPort as c,createAuthSession as u,loadLoginMethods as p,detectPasskeySupport as d}from"@seamless-auth/client";import{jsx as h}from"react/jsx-runtime";const l=e(void 0),k=()=>{const e=t(l);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e},m=({children:e,apiHost:t,autoDetectPreviousSignin:a=!0,magicLinkRedirectUri:p,transport:d,ports:k,initialSession:m})=>{const g=s(()=>({passkeys:k?.passkeys??c(),oauthRedirect:k?.oauthRedirect??n()}),[k?.passkeys,k?.oauthRedirect]);if("bearer"===d?.mode)throw new TypeError("@seamless-auth/react is cookie transport only, so the browser never holds the tokens. Use @seamless-auth/react-native for bearer transport in a native app.");const{basePath:v,fetch:y,trustedOrigins:S}=d??{},b=S?JSON.stringify(S):void 0,f=s(()=>d?{mode:"cookie",basePath:v,fetch:y,trustedOrigins:b?JSON.parse(b):void 0}:void 0,[v,y,b]),w=r(m),P=s(()=>u({apiHost:t,magicLinkRedirectUri:p,transport:f,passkeys:g.passkeys,detectPreviousSignIn:a,initialSession:w.current}),[t,p,f,g.passkeys,a]),R=i(P.subscribe,P.getState,P.getServerState);o(()=>{P.actions.refreshSession({background:void 0!==w.current})},[P]);const O=s(()=>({...R,...P.actions,apiHost:t,magicLinkRedirectUri:p,client:P.client,ports:g}),[R,P,t,p,g]);return h(l.Provider,{value:O,children:e})},g=()=>k().client,v=()=>{const e=g(),[t,s]=a(null),[r,i]=a(!0);return o(()=>{let t=!0;return p(e).then(e=>{t&&(e&&s(e),i(!1))}),()=>{t=!1}},[e]),{loginMethods:t,loading:r}},y=()=>{const{ports:e}=k(),[t,s]=a(!1),[r,i]=a(!0);return o(()=>{let t=!0;return d(e.passkeys).then(e=>{t&&(s(e),i(!1))}),()=>{t=!1}},[e.passkeys]),{passkeySupported:t,loading:r}};export{m as A,g as a,v as b,y as c,k as u};
|
|
3
|
-
//# sourceMappingURL=shared-D9GCCBrm.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"shared-D9GCCBrm.js","sources":["../../src/AuthProvider.tsx","../../src/hooks/useAuthClient.ts","../../src/hooks/useLoginMethods.ts","../../src/hooks/usePasskeySupport.ts"],"sourcesContent":[null,null,null,null],"names":["AuthContext","createContext","undefined","useAuth","context","useContext","Error","AuthProvider","children","apiHost","autoDetectPreviousSignin","magicLinkRedirectUri","transport","ports","providedPorts","initialSession","useMemo","passkeys","createBrowserPasskeyPort","oauthRedirect","createBrowserOAuthRedirect","mode","TypeError","basePath","fetch","fetchImpl","trustedOrigins","trustedOriginsKey","JSON","stringify","stableTransport","parse","initialSessionRef","useRef","session","createAuthSession","detectPreviousSignIn","current","state","useSyncExternalStore","subscribe","getState","getServerState","useEffect","actions","refreshSession","background","value","client","_jsx","Provider","useAuthClient","useLoginMethods","authClient","loginMethods","setLoginMethods","useState","loading","setLoading","active","loadLoginMethods","then","methods","usePasskeySupport","passkeySupported","setPasskeySupported","detectPasskeySupport","supported"],"mappings":";sVA4GA,MAAMA,EAAcC,OAA2CC,GAMlDC,EAAU,KACrB,MAAMC,EAAUC,EAAWL,GAC3B,IAAKI,EACH,MAAM,IAAIE,MAAM,+CAElB,OAAOF,GAgCIG,EAA4C,EACvDC,WACAC,UACAC,4BAA2B,EAC3BC,uBACAC,YACAC,MAAOC,EACPC,qBAKA,MAAMF,EAAQG,EACZ,KAAA,CACEC,SAAUH,GAAeG,UAAYC,IACrCC,cAAeL,GAAeK,eAAiBC,MAEjD,CAACN,GAAeG,SAAUH,GAAeK,gBAM3C,GAA4D,WAAvDP,GAA8CS,KACjD,MAAM,IAAIC,UACR,+JAIJ,MAAMC,SAAEA,EAAUC,MAAOC,EAASC,eAAEA,GAAmBd,GAAa,CAAA,EAE9De,EAAoBD,EAAiBE,KAAKC,UAAUH,QAAkBxB,EACtE4B,EAAkBd,EACtB,IACEJ,EACI,CACES,KAAM,SACNE,WACAC,MAAOC,EACPC,eAAgBC,EACXC,KAAKG,MAAMJ,QACZzB,QAENA,EAEN,CAACqB,EAAUE,EAAWE,IAMlBK,EAAoBC,EAAOlB,GAE3BmB,EAAUlB,EACd,IACEmB,EAAkB,CAChB1B,UACAE,uBACAC,UAAWkB,EACXb,SAAUJ,EAAMI,SAChBmB,qBAAsB1B,EACtBK,eAAgBiB,EAAkBK,UAEtC,CACE5B,EACAE,EACAmB,EACAjB,EAAMI,SACNP,IAOE4B,EAAQC,EACZL,EAAQM,UACRN,EAAQO,SACRP,EAAQQ,gBAcVC,EAAU,KACHT,EAAQU,QAAQC,eAAe,CAClCC,gBAA0C5C,IAA9B8B,EAAkBK,WAE/B,CAACH,IAEJ,MAAMa,EAAQ/B,EACZ,KAAA,IACKsB,KACAJ,EAAQU,QACXnC,UACAE,uBACAqC,OAAQd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