8000 feat(auth): sign in with passkeys, no passwords by adeelahmad · Pull Request #73 · adeelahmad/lense · GitHub
[go: up one dir, main page]

Skip to content

feat(auth): sign in with passkeys, no passwords - #73

Merged
adeelahmad merged 11 commits into
mainfrom
claude/project-thread-syn7pr
Oct 3, 2026
Merged

adeelahmad merged 11 commits into
mainfrom
claude/project-thread-syn7pr

Conversation

@adeelahmad
@adeelahmad adeelahmad commented Oct 3, 2026 •
Copy link
Copy Markdown
Owner

Requested by Adeel · project thread

Description

Before: everyone signed in with an email and password; the first admin chose a password on the setup page.

After: people sign in with a passkey (fingerprint, face or device PIN, or a phone nearby). A fresh install has no passwords at all, not even on a plain http:// address.

  • Setup: the first admin enters the setup code (filled in from the setup link), name and email and taps "Create admin with a passkey". On a plain http:// address (not localhost) browsers refuse passkeys, so there the code alone creates the admin, still with no password.
  • Sign in: one passkey button. On a plain http:// address the page offers a one-time sign-in link instead. The password form only shows where an admin allows passwords.
  • New people and lost devices: admins create an account (with a namespace role) and get a one-time sign-in link (People › Send a sign-in link…, or lens users link email). Opening it adds a passkey and signs in; on plain http:// the link signs in by itself, once. "Get a sign-in link" emails one through Settings › Email. Admins can remove someone's passkeys, which signs them out everywhere.
  • Profile and sign-in: list, add, rename and remove passkeys (never the last one, or the last one for the address you're on).
  • Settings › Sign-in › Allow passwords: turning it off needs an admin with a passkey first. Installs that already use passwords keep them on after upgrading.
  • The signed-out dialog signs back in with a passkey too.

Motivation and Context

Adeel asked for passkeys with no passwords at all. This is the first of the sign-in PRs in this thread; external OIDC/OAuth sign-in (Google, GitHub, Microsoft, generic OIDC), the built-in Cloudflare tunnel and hardening follow as separate PRs.

How: py_webauthn (webauthn 2.8) checks the ceremonies. The browser runs them against the API through the web app (so the API knows the site's origin; forwarded hosts are only accepted for known hosts or trusted proxies) and gets a one-time, two-minute ticket, which a new NextAuth ticket provider swaps for the usual token pair. User verification is required and cloned keys (counter going backwards) are refused. Sign-in link tokens live in the URL fragment, so they never reach a server log.

Review fixes: per-visitor throttles no longer share one bucket when the visitor is unknown, a link request no longer cancels an admin's link, a link isn't spent when the passkey limit is reached.

Screenshots (if appropriate):

Checked end to end in Chromium with a virtual authenticator: setup with a passkey, sign in with it, Profile lists it, an admin makes a sign-in link and a second browser adds a passkey through it. On a non-secure origin: code-only setup with no password field, the login page offers a sign-in link, and the link signs in by itself.

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. Backend: 478 pass on the merged tree (15 passkey tests with a software authenticator); the LibreOffice conversion test fails as before (environment); auth tests also pass against a SurrealDB 3.2.4 server. Frontend: 616 pass, tsc and eslint clean.
  • 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.

🤖 Generated with Claude Code

https://claude.ai/code/session_01PdZQpHGY1mLEGZYNTpo6jc

People sign in with a passkey (WebAuthn): fingerprint, face or device PIN. The
first admin makes one on the setup page; everyone else gets a one-time sign-in
link from People, `lens users link`, or "Lost your passkey?" by email.
Profile and sign-in manages passkeys. Fresh installs have no passwords
(auth.passwords off); installs that already use them keep them until an admin
turns them off, which needs an admin with a passkey.

The browser runs the ceremony against the API through the web app, which
knows the site's origin; the API answers a one-time ticket that NextAuth's
"ticket" provider swaps for a session.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PdZQpHGY1mLEGZYNTpo6jc
@adeelahmad adeelahmad self-assigned this Oct 3, 2026
claude added 10 commits October 3, 2026 03:23
On a plain http:// address (where browsers refuse passkeys) setup now
takes the one-time setup code alone, and a sign-in link signs in by
itself once, so Lens never falls back to a password.

Also from review: per-visitor throttles no longer share one bucket,
removing a passkey keeps one for the current site, an emailed link no
longer cancels an admin's link, and a link isn't spent when the
passkey limit is reached.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PdZQpHGY1mLEGZYNTpo6jc
Keeps both changelog entries and setup tests; main's model-server test
turns passwords on before signing in with one. The setup page now fills
in the code from /setup?code=… as the one-line installer expects.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PdZQpHGY1mLEGZYNTpo6jc
Keeps both the Sign-in and Components settings sections and both test
config entries; regenerated the OpenAPI client.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PdZQpHGY1mLEGZYNTpo6jc
Regenerated the OpenAPI client over main's SPARQL and metadata routes.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PdZQpHGY1mLEGZYNTpo6jc
Regenerated the OpenAPI client over main's assistant and voice routes.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PdZQpHGY1mLEGZYNTpo6jc
Sign-in link emails go through the email server set up in Settings ›
Email, like password resets, and their links use the app's address.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PdZQpHGY1mLEGZYNTpo6jc
Keeps the passwordless setup form with #67's setup-link hint (the code
filled in from the link, or `make setup-code` to copy).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PdZQpHGY1mLEGZYNTpo6jc
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PdZQpHGY1mLEGZYNTpo6jc
New people get a namespace role and a sign-in link in the same step.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PdZQpHGY1mLEGZYNTpo6jc
@adeelahmad
adeelahmad merged commit f4ce739 into main Oct 3, 2026
0 of 5 checks passed
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