8000 feat(auth): open Lens's other addresses signed in, to add a passkey there by adeelahmad · Pull Request #537 · adeelahmad/lense · GitHub
[go: up one dir, main page]

Skip to content

feat(auth): open Lens's other addresses signed in, to add a passkey there - #537

Merged
adeelahmad merged 1 commit into
mainfrom
claude/project-thread-ppx7di
Oct 18, 2026
Merged

adeelahmad merged 1 commit into
mainfrom
claude/project-thread-ppx7di

Conversation

@adeelahmad
Copy link
Copy Markdown
Owner

Description

Before: a passkey works only at the address it was made at, so one made at localhost or on the network failed at the Remote access (tunnel) or HTTPS address, and getting a passkey there took a sign-in link from email or from an admin. Remote access in the browser worked; signing in there with your passkey did not.

After: Profile and sign-in › Passkeys lists Lens's other addresses, each saying whether you have a passkey for it, with Open signed in next to one you don't. It opens that address with a 15-minute, one-time sign-in link of your own, where one fingerprint adds a passkey for it and signs you in. No email, admin or copied link. When a passkey sign-in is cancelled or matches nothing, the sign-in page says a passkey works only where it was made and points to Open signed in.

How: GET /api/v1/auth/passkeys/elsewhere lists the addresses Lens opens at (FRONTEND_URL, server.allowed_hosts, the Remote access and HTTPS addresses) with a per-address passkey check; POST mints a sign-in link through the existing magic-link code for the signed-in user only (never an API token or app), leaves other links alone and audits it as passkey.elsewhere. The web app's webauthn.ts gains passkeySignInMessage for the cancelled/no-match hint. Remote access's quick address changes each start, so the docs say to use your own domain to keep a passkey.

Motivation and Context

The owner asked whether passkeys work at the remote URL and said he didn't think so. They don't by WebAuthn's design (the RP ID is the host), so this gives the person a one-click way to add one at the other address instead. Follows #402 and #508, which made the file shares and MQTT reachable through Remote access.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change; ! in the title)

Checklist:

  • The title is a Conventional Commit.
  • My code follows the code style of this project (make hooks checks it on commit).
  • I added or updated tests.
  • My change requires documentation updates, and I have updated docs/ accordingly.
  • Users need more than the title to understand it, so I wrote it under ## Unreleased in CHANGELOG.md.

Done questions (AGENTS.md)

  • Goal: a passkey at the remote address in one click from a signed-in session; merged on green CI.
  • Agents: GET/POST /api/v1/auth/passkeys/elsewhere in the OpenAPI; the mint is for people signed in themselves, by design, since it hands out a sign-in.
  • Zero setup: nothing to configure; addresses come from what Lens already knows.
  • Fewest clicks: one click opens the other address signed in; one fingerprint there adds the passkey.
  • Configurable: n/a, no new setting; the address list follows the existing Remote access and HTTPS settings.
  • Light: no new dependency.
  • Private and secure: 15-minute, one-time link, only for the signed-in person's own account, audited; threat model updated (entry point, P-AUTH companions).
  • Cost: n/a, no model calls.
  • User decides: nothing happens until they click Open signed in; existing defaults unchanged.
  • Upgrades: no stored-data change.
  • Honest: docs say exactly what works where and that the tunnel's quick address changes; README built list and docs/requirements.md row added.
  • Tests (backend test_taking_your_sign_in_to_another_address, test_the_addresses_lens_opens_at; web passkeys-panel.test.tsx, webauthn.test.ts), docs and generated files (make openapi) updated.
  • Open standards: WebAuthn as is; the fix works with its host binding rather than around it.
  • Result reported in the thread with evidence; refine later: a QR code of the link for a phone next to the computer.
  • Reuse: the existing magic-link code and passkey registration flow; no new auth path.

Local CI (ci/local-ci.sh): FastAPI, Next.js, pre-commit and PR title pass; after the rebase onto #508 the passkey tests (18 backend, 22 web) and the threat-model validator pass again.


Generated by Claude Code

…here

A passkey works only at the address it was made at, so one made at localhost
or on the network didn't work at the Remote access or HTTPS address, and
getting one there needed a sign-in link from email or an admin. Profile ›
Passkeys now lists Lens's other addresses (GET /auth/passkeys/elsewhere) with
Open signed in (POST): a 15-minute, one-time sign-in link of your own at that
address, for people signed in themselves only, leaving other links alone.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CXpr1EWCfUD5tb1SmSwfDa
@adeelahmad
adeelahmad merged commit 5563a4e into main Oct 18, 2026
12 checks passed
@adeelahmad
adeelahmad deleted the claude/project-thread-ppx7di branch October 18, 2026 01:36
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

0