Skip to content

Allow changing the administrator password - #710

Merged
dahlia merged 1 commit into
fedify-dev:mainfrom
dahlia:feat/password-change
Nov 29, 2026
Merged

dahlia merged 1 commit into
fedify-dev:mainfrom
dahlia:feat/password-change

Conversation

@dahlia

@dahlia dahlia commented Nov 29, 2026

Copy link
Copy Markdown
Member

Previously, changing Hollo's administrator password after setup required updating the stored hash directly in PostgreSQL. A signed-in administrator can now open Auth, enter the current password, and confirm a new one. Editing the current password field clears its previous error.

The server replaces the Argon2id hash only if the stored hash still matches the one it verified. If another request changes the password in the meantime, the form asks the administrator to try again with the current password. The new password applies to subsequent sign-ins. Existing browser sessions and authorized apps stay active.

Sentry skips the password-change request body. The update skips SQL query logging because it binds the old and new password hashes.

Fixes #709.

Add a password change form to the Auth dashboard. Verify the current
password and conditionally replace its Argon2id hash so concurrent
submissions cannot overwrite an earlier change. Keep existing browser
sessions and authorized applications working.

Exclude passwords and hashes from query and error reporting. Cover the
form, login behavior, and concurrent updates in tests, and document the
feature in the setup guides and changelog.

Fixes fedify-dev#709

Assisted-by: Codex:gpt-6.2-sol
Assisted-by: Codex:gpt-6.2-astra
Assisted-by: Claude Code:claude-sonnet-5-5
@dahlia dahlia added this to the Hollo 0.10 milestone Nov 29, 2026
@dahlia dahlia self-assigned this Nov 29, 2026
@dahlia dahlia added the enhancement New feature or request label Nov 29, 2026
@coderabbitai

coderabbitai Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The Auth page now lets administrators change their login password by providing the current password and confirming a new one. The flow validates and updates the credential, reports success or errors, and documents that existing sign-ins and authorized apps remain active.

Changes: Administrator Password Change

Layer / File(s) Summary
Credential verification and update
src/admin-password.ts
changeAdminPassword checks credential availability, verifies the current password, and conditionally updates the stored hash.
Auth route and submission handling
src/pages/auth.tsx, src/pages/auth-password.test.ts, src/sentry.ts, src/sentry.test.ts
The Auth routes validate submissions, handle operation results, and consume signed success notices. Tests cover validation, session requirements, failures, and concurrent updates. Sentry excludes request bodies for matching Auth POST requests.
Form, feedback, and documentation
src/components/ChangePasswordForm.tsx, src/components/forms.tsx, src/public/change-password.js, CHANGES.md, changes.d/admin-password-change.md, docs/src/content/docs/{install/setup.mdx,ja/install/setup.mdx,ko/install/setup.mdx,zh-cn/install/setup.mdx,zh-tw/install/setup.mdx}
The dashboard displays the form and validation feedback. Shared fields connect hints and errors to inputs, and the client script clears current-password error styling after input. Setup guides and release notes describe the change.

Estimated code review effort: 4 (Complex) | ~45 minutes

Change: Feature · Severity of issue fixed: Medium

Sequence Diagram(s)

sequenceDiagram
  actor Administrator
  participant AuthPOST
  participant changeAdminPassword
  participant CredentialStore
  Administrator->>AuthPOST: Submit current password and new password
  AuthPOST->>changeAdminPassword: Verify and change password
  changeAdminPassword->>CredentialStore: Read credential and verify current password
  changeAdminPassword->>CredentialStore: Update hash if email and prior hash match
  AuthPOST-->>Administrator: Redirect with signed success notice or render error
Loading
Merge Risk: Minimal · up to 86f12

Administrators can now change their login password from the Auth page. The change checks the current password, rejects concurrent overwrites, and keeps existing sessions active. No concrete merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "Allow changing the administrator password" states the main change: a dashboard form that lets an administrator change the login password. The changeset adds the Auth page form, the changeAd…
Description check Passed The description explains the new Auth page form, the compare-and-swap hash update, the Sentry body skip, and the SQL logging skip. It also references the fixed issue #709. All of these match the chang…
Linked Issues check Passed Issue #709 requires a password-change form on the dashboard Auth page. The form asks for the current password, a new password, and a confirmation. After saving, the new password must work for sign-in …
Out of Scope Changes check Passed All changed areas connect to the #709 objective or to its required support. The password-change feature includes admin-password.ts, ChangePasswordForm.tsx, auth.tsx, change-password.js, the forms.tsx …
Full details: Title check

Explanation

The title "Allow changing the administrator password" states the main change: a dashboard form that lets an administrator change the login password. The changeset adds the Auth page form, the changeAdminPassword function, and the tests and docs for that flow, so the title matches the primary change.

Full details: Description check

Explanation

The description explains the new Auth page form, the compare-and-swap hash update, the Sentry body skip, and the SQL logging skip. It also references the fixed issue #709. All of these match the changeset.

Full details: Linked Issues check

Explanation

Issue #709 requires a password-change form on the dashboard Auth page. The form asks for the current password, a new password, and a confirmation. After saving, the new password must work for sign-in and the old password must be rejected. Per the change summary, the PR adds ChangePasswordForm (src/components/ChangePasswordForm.tsx), which posts current password, new password, and confirmation to /auth. The POST handler in src/pages/auth.tsx validates the fields and calls changeAdminPassword (src/admin-password.ts). That function verifies the current password with Argon2id, then replaces the stored hash only if the email and prior hash still match. Because the stored hash is replaced, the old password fails verification and the new password is accepted on later sign-ins. The login code path is not changed. The test file src/pages/auth-password.test.ts covers successful changes, validation failures, authentication requirements, and concurrent updates. Limitation: the change summary does not explicitly state that a sign-in test uses the new password. The conclusion for the sign-in requirement rests on the hash replacement logic and the unchanged login path. No coding requirement from #709 is unmet.

Full details: Out of Scope Changes check

Explanation

All changed areas connect to the #709 objective or to its required support. The password-change feature includes admin-password.ts, ChangePasswordForm.tsx, auth.tsx, change-password.js, the forms.tsx aria-describedby update (used by the new form's field errors), and tests. The sentry.ts and sentry.test.ts changes add an ignoreRequestBody rule and a test. The PR description states this rule keeps the password-change request body out of Sentry, so it is a security measure for the new feature. The changelog and changes.d note reference #709 and #710. The setup guide updates in English, Japanese, Korean, Simplified Chinese, and Traditional Chinese document the new feature. Documentation is a legitimate part of a user-facing feature. No change was found that is unrelated to #709.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5b1023d7-6fd0-4960-a857-1f4c3b5e5b63
Commits

Reviewing files that changed from the base of the PR and between aa19941 and 86f124e.

Files selected for processing: 15

  • CHANGES.md
  • changes.d/admin-password-change.md
  • docs/src/content/docs/install/setup.mdx
  • docs/src/content/docs/ja/install/setup.mdx
  • docs/src/content/docs/ko/install/setup.mdx
  • docs/src/content/docs/zh-cn/install/setup.mdx
  • docs/src/content/docs/zh-tw/install/setup.mdx
  • src/admin-password.ts
  • src/components/ChangePasswordForm.tsx
  • src/components/forms.tsx
  • src/pages/auth-password.test.ts
  • src/pages/auth.tsx
  • src/public/change-password.js
  • src/sentry.test.ts
  • src/sentry.ts

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

@dahlia
dahlia merged commit ed4ad2a into fedify-dev:main Nov 29, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow changing the admin login password

1 participant