mirror of
https://github.com/wu736139669/hapi.git
synced 2026-12-04 06:57:55 +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.
15 lines
761 B
TypeScript
15 lines
761 B
TypeScript
import { cp, mkdir, rm } from 'node:fs/promises'
|
|
import { resolve } from 'node:path'
|
|
|
|
// Independent output: never deploy the marketing app/scripts to this origin.
|
|
const outdir = resolve(import.meta.dir, '../../website/dist/auth')
|
|
await rm(outdir, { recursive: true, force: true })
|
|
await mkdir(outdir, { recursive: true })
|
|
await cp(resolve(import.meta.dir, '../passkey-site'), outdir, { recursive: true })
|
|
const result = await Bun.build({
|
|
entrypoints: [resolve(import.meta.dir, '../src/passkey-site/main.ts')],
|
|
outdir, target: 'browser', minify: true, naming: 'main.js'
|
|
})
|
|
if (!result.success) throw new AggregateError(result.logs, 'Passkey site build failed')
|
|
console.log(`Static passkey site: ${outdir} (deploy only this directory to auth.hapi.run)`)
|