mirror of
https://github.com/wu736139669/hapi.git
synced 2026-11-24 04:47:03 +00:00
Use auth.hapi.run as the shared RP with an isolated static browser bridge, Hub-bound challenges and accounts, and one-time PKCE code exchange. Update iOS and Android validation, app associations, deployment documentation, and bidirectional browser regression coverage.
12 lines
788 B
TypeScript
12 lines
788 B
TypeScript
// Bundled only by the isolated browser regression harness, not the auth site.
|
|
import { ApiClient } from '../src/api/client'
|
|
import { registerPasskey, signInWithPasskey } from '../src/lib/passkey'
|
|
const api = new ApiClient(document.body.dataset.token!, { baseUrl: location.origin })
|
|
const output = document.querySelector('#result')!
|
|
document.querySelector('#register')!.addEventListener('click', () => {
|
|
void registerPasskey(api, 'Browser integration').then(() => { output.textContent = 'registered' }).catch((e) => { output.textContent = String(e) })
|
|
})
|
|
document.querySelector('#login')!.addEventListener('click', () => {
|
|
void signInWithPasskey(location.origin).then((session) => { output.textContent = `session:${session}` }).catch((e) => { output.textContent = String(e) })
|
|
})
|