Skip to content

fix: drop a saved Zen-era login instead of failing on the first signature - #137

Merged
scobru merged 1 commit into
mainfrom
claude/dazzling-franklin-yj0co6
Oct 6, 2026
Merged

scobru merged 1 commit into
mainfrom
claude/dazzling-franklin-yj0co6

Conversation

@scobru

@scobru scobru commented Oct 6, 2026

Copy link
Copy Markdown
Owner

Bug

After #136, a browser still holding the login saved by the old Zen-based page (tunecamp_zen_user) passed those keys to signData, which threw RangeError: offset is out of bounds. On sso.html this showed as "Errore durante la generazione crittografica" and the SSO could not complete. profile.html and the player read the same stored session. My miss in #136: users were told to expect new keys, but the stale session was never handled.

Fix

  • vendor/identity.js re-vendored from fid 5.0.1: a bad key now fails with a readable error, and isValidPair(pair) checks that the private key really produces the public one.
  • sso.html: a legacy session is removed and the page says so ("la tua identità precedente usava il vecchio sistema Zen SEA… creane una nuova dal Profilo").
  • profile.html: a legacy saved login is removed, with one notice, and the sign-in form shows.
  • components/library-sync.js: readIdentity ignores keys with the wrong shape, and new readValidIdentity (used by the player) also runs the derivation check and removes a stale session.

Companion to scobru/fid#6, which does the same for the portal.

Test plan

  • library-sync.test.js now 28 assertions (adds: Zen-shaped session, right-shape-wrong-key, real identity kept), plus library 50, instance-import 36, url-safety 15.
  • Headless Chromium with a Zen-shaped session seeded: sso.html shows the message and profile.html shows the notice and the sign-in form, both remove the session, no page errors.
  • tests/player.e2e.cjs: still 54 checks.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FeCp9YZh9dCEHXtRdpVeFe


Generated by Claude Code

…ture

sso.html, profile.html and the player reloaded the login stored by the old
Zen-based page and passed its keys to signData, which threw RangeError
(offset is out of bounds). They now check that the private key produces the
public one (isValidPair, from fid 5.0.1), remove a legacy session and say so.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FeCp9YZh9dCEHXtRdpVeFe
@vercel

vercel Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
tunecamp Ready Ready Preview Oct 6, 2026 4:53pm UTC

@scobru
scobru merged commit 9a34641 into main Oct 6, 2026
3 checks passed

This branch was successfully deployed

1 active deployment
Preview — 0f19db5d Deployed Oct 6, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants