added: one-time password links, self-service passwords, and sign out everywhere #8
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "password-links"
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?
Replaces passwords that admins pass on with one-time password links. An admin sends a person a link, and the person chooses their own password there. The same link will work for email reset later. This follows the design we settled on in the thread.
What changes for people
/password/{token}shows a read-onlyusernamefield and anew-passwordfield, so password managers save the new password for the right account. The heading says "Choose a password" or "Reset your password". When the form succeeds, Consent signs them in and sends them home. Expired, used and unknown links each get their own page. If the browser is signed in as someone else, the page only offers "Sign out and continue"./account. There they can change their password by giving the current one, which keeps their existing sign-ins, and press "Sign out everywhere".PUT/DELETE /admin/users/{subject}/passwordandPOST /admin/users/{subject}/password-link.passwordis optional on create, and users reporthas_password. The CLI gainsusers password set|clear|link, andusers createprints the created user.make compose-admintakes onlyADMIN_USERand prints a link.Rules the code enforces
Only actions that sign everyone out cancel a link. An attacker who knows the password therefore can't cancel a reset in progress. Using a link claims it with one conditional update, so it works exactly once, even if the form is submitted twice at the same moment. Tokens are stored only as SHA-256 hashes.
Notes for review
user.secretis nullable, andpassword_linkhas one row per user.PublicURLto build link URLs, andNewrejects a missing or invalid one./accountpage, reached from the handle in the top bar, rather than on the home page. I chose this to keep the home page about apps.TestNavigationexpects members to see only "Apps".internal/service/store.go.make testpasses./account, and signed out everywhere.make mock-deployment. It still creates its demo users with--password, which keeps working.🤖 Generated with Claude Code
A password link opens /password/{token}. The page shows the account's handle in a read-only username field above a new-password field, so password managers save the new password for the right account. Its heading depends on whether the account already has a password. Using the link signs the person in and sends them home. When the browser is signed in to a different account, the page offers only to sign out and come back to the link. Expired, used, and unknown links each get their own explanation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>Creating a user through the API no longer requires a password. A user created without one can't sign in until they use a password link. User responses now include has_password, and 'consent api users create' prints the created user. New routes under /admin/users/{subject} set or clear a password, or make a password link. The CLI exposes them as 'users password set', 'clear', and 'link'. Setting a password stays available because scripted setups, such as the mock deployment, need accounts with known passwords. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>