Device approve page: manual code-entry for the QR-less path #5
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/device-approve-code-entry"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #55.
Problem
The TV's sign-in screen tells the user to "open
…/deviceand enter the code", butdevice_page.pb.jsonly worked when opened with?code=(what the QR encodes). Opening…/devicebare showed "Chybí kód zařízení v odkazu." and hid the form — there was no field to type theXXXX-XXXXcode into. So the QR/direct-link path worked, but the "type the code" path the TV advertises didn't exist.Fix
Added a code-entry field shown when the page is opened without
?code=:XXXX-XXXXcode from the TV; input formats live toXXXX-XXXXand Enter submits.normCode: uppercase, strip dash/spaces, cap at 8) to the dash-less form the server stores — the fix the issue called for — before the/info+/approvelookups.CODEnow also runs through the same normalizer, so even a dashed link works.No new endpoints, no crypto changes, self-contained page (no external assets) preserved.
Verification
nodesyntax-check of the hook and the inner browser<script>(compile-only vianew Function).normCode/fmtCode/length gate): dashed↔dashless mapping, live formatting, 8-char cap, null-safety, and the submit gate accepting full codes (dashed or not) while rejecting short/empty. All pass.Docs
docs/device-auth-contract.md— noted the optional?code=and the normalization on the/deviceroute.🤖 Generated with Claude Code