OverviewFilesCommitsIssuesDocsReleasesPeers

hyper-booking commits / 3078bb1

Fix sign-in: use sync crypto (no crypto.subtle needed)
Root cause: crypto.subtle is only available over HTTPS or localhost. Accessing via http://tabertron.local blocks crypto.subtle entirely. Fix: use ed.getPublicKey() (sync) instead of ed.getPublicKeyAsync() which relied on crypto.subtle.digest('SHA-512'). The sync path uses our vendored sha512Sync which works on plain HTTP. Also added try/catch + visible error toast to sign-in button handler. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
3078bb118aa265e1504845faece7a697141f6fba
by plankatron <fleeky@gmail.com> · 2026-03-22T19:13:48.000Z

Changed files (2) +15 -6

web/js/app.js +14 -5
……@@ -50,15 +50,24 @@ function formatPrice (cents) {
5050const signInBtn = document.getElementById('sign-in-btn')
5151if (signInBtn) {
5252 signInBtn.addEventListener('click', async () => {
53 if (typeof HyperBookingIdentity !== 'undefined' && HyperBookingIdentity.hasKeypair()) {
54 showToast('Already signed in')
55 return
56 }
57 if (typeof HyperBookingIdentity !== 'undefined') {
53 try {
54 if (typeof HyperBookingIdentity === 'undefined') {
55 showToast('Identity module not loaded', 'error')
56 return
57 }
58 if (HyperBookingIdentity.hasKeypair()) {
59 showToast('Already signed in')
60 return
61 }
62 signInBtn.textContent = 'Signing in...'
5863 await HyperBookingIdentity.generate()
5964 showToast('Identity created', 'success')
6065 signInBtn.textContent = 'Signed In'
6166 showDashboardLink()
67 } catch (err) {
68 showToast('Sign-in failed: ' + err.message, 'error')
69 signInBtn.textContent = 'Sign In'
70 console.error('[Sign-in error]', err)
6271 }
6372 })
6473
web/js/identity.js +1 -1
……@@ -73,7 +73,7 @@ window.HyperBookingIdentity = (function () {
7373 var seed = new Uint8Array(32)
7474 crypto.getRandomValues(seed)
7575
76 var publicKeyBytes = await ed.getPublicKeyAsync(seed)
76 var publicKeyBytes = ed.getPublicKey(seed)
7777
7878 var secretKeyBytes = new Uint8Array(64)
7979 secretKeyBytes.set(seed, 0)