///
// Approve page for codeless device sign-in (epic #6, issue #12).
//
// Served at GET /device?code=CODE — the QR the TV shows encodes exactly this URL.
// The page is self-contained (no external assets, no CDN): the user signs in with
// email + password, the page derives the addon-config vault key (#20) from the
// password, seals it to the TV's ephemeral public key, and approves the request.
//
// Crypto here MUST match the app byte-for-byte (verified by the app's
// device_key_transfer_test + addon_config_crypto_interop_test against fixed
// vectors this same code produced under Node):
// - vault key: PBKDF2-HMAC-SHA256, 210000 iters, 256-bit, salt = account salt
// (addon_config_crypto.dart).
// - key transfer: X25519 (vendored TweetNaCl scalarMult, RFC 7748) → HKDF-SHA256
// (salt="", info="amber-device-key-v1") → AES-256-GCM (12B nonce, 128b tag),
// blob = ephPub[32] ‖ nonce[12] ‖ ct ‖ tag[16], base64 (device_key_transfer.dart).
//
// The password never leaves the page; the vault key is sealed to the TV and never
// reaches the server (E2E for this one blob). The minted token is delivered by the
// poll route, not here.
routerAdd("GET", "/device", (e) => {
return e.html(200, DEVICE_APPROVE_HTML)
})
const DEVICE_APPROVE_HTML = `
Amber — přihlásit zařízení
`