You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Updated passkey plugin to use VerifiedPasskey types
- Removed legacy WebAuthn JSON handling
- Removed email_otp from second factor methods and updated types
- Added deterministicTokenHash for stable token generation
- Implemented rate limiting in email‑otp and magic‑link flows
- Refactored OAuth2 plugin to use an authorization‑code exchange
- Added idempotency support and updated docs, examples, and tests
@@ -211,19 +211,23 @@ const result = await auth.authenticate({
211
211
authorizationCode: "code-from-callback",
212
212
redirectUri: process.env.GOOGLE_REDIRECT_URI!,
213
213
codeVerifier: "pkce-code-verifier",
214
+
idempotencyKey: "oauth-state",
214
215
});
215
216
```
216
217
217
218
### Passkey
218
219
219
220
- Method: `"passkey"`
220
221
- Register + authenticate supported.
222
+
- The package consumes already-verified passkey results; it does not perform raw WebAuthn attestation/assertion verification.
223
+
- Verify WebAuthn with `@simplewebauthn/server` or equivalent first, then pass the verified result into `auth.register(...)` / `auth.authenticate(...)`.
- OTP/magic-link/2FA challenge consumption must be atomic to prevent replay races.
1445
1451
- OTP verification must be bound to `challengeId` (never resolve active challenge only by email).
1446
-
- Passkey verification must validate challenge, origin, RP ID, and signature counter.
1452
+
- Passkey verification must validate challenge, origin, RP ID, and signature counter before calling this package; the package consumes already-verified passkey results.
1447
1453
- OAuth2 callbacks must use `state`/PKCE and be idempotent against duplicate provider callbacks.
1448
1454
- Session expiration + rotation support.
1449
1455
-`accountDiscovery.mode = "private"` should avoid leaking user existence through explicit routing messages.
@@ -2347,9 +2353,9 @@ Fix in spec:
2347
2353
- For email OTP verify/register, require and validate `challengeId` (avoid "latest challenge by email" lookup).
2348
2354
- For out-of-band methods, use explicit delivery handlers for sending; use events only for observability/policy.
2349
2355
- Use atomic compare-and-set for one-time credentials/challenges/recovery-code consumption.
2350
-
- For passkeys, strictly verify RP ID/origin/challenge and store updated counters after successful assertions.
2356
+
- For passkeys, require verified registration/authentication results from a WebAuthn library and store updated counters after successful assertions.
2351
2357
- For 2FA, bind second-factor verification to `pendingAuthId` and consume challenge on success.
2352
-
- For OAuth/passkey partial signups, return `PROFILE_COMPLETION_REQUIRED` with missing fields and pending profile ID.
2358
+
- For OAuth partial signups, return `PROFILE_COMPLETION_REQUIRED` with missing fields and pending profile ID.
2353
2359
- For organizations, enforce tenant scoping and membership status checks before permission/feature/limit evaluation.
2354
2360
- For organizations, ensure bootstrap and seat-limited membership creation are atomic.
2355
2361
- For organizations, validate role catalog on startup (default role, owner role, no cyclic inheritance).
0 commit comments