Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 21 additions & 18 deletions src/pages/accounts/server/handler.webAuthn.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -49,24 +49,6 @@ export const POST = handler.fetch // Next.js

## Parameters

### challengeTtl

- **Type:** `number`
- **Default:** `300` (5 minutes)

Maximum age of a challenge in seconds before it expires.

```ts twoslash
import { Handler, Kv } from 'accounts/server'

const handler = Handler.webAuthn({
kv: Kv.memory(),
origin: 'https://example.com',
rpId: 'example.com',
challengeTtl: 600, // [!code focus]
})
```

### kv

- **Type:** [`Kv`](/accounts/server/kv)
Expand Down Expand Up @@ -175,3 +157,24 @@ const handler = Handler.webAuthn({
rpId: 'example.com', // [!code focus]
})
```

### ttl

- **Type:** `{ challenge?: number; session?: number }`
- **Default:** `{ challenge: 300, session: 86400 }`

TTLs in seconds for challenges (5 minutes) and sessions (24 hours).

```ts twoslash
import { Handler, Kv } from 'accounts/server'

const handler = Handler.webAuthn({
kv: Kv.memory(),
origin: 'https://example.com',
rpId: 'example.com',
ttl: { // [!code focus]
challenge: 600, // [!code focus]
session: 3600, // [!code focus]
}, // [!code focus]
})
```
Loading