Skip to content

fix(user): allow GitHub-only accounts to edit profile without a password#1807

Merged
edward-ly merged 1 commit into
masterfrom
fix/github-account-password-required
Jul 11, 2026
Merged

fix(user): allow GitHub-only accounts to edit profile without a password#1807
edward-ly merged 1 commit into
masterfrom
fix/github-account-password-required

Conversation

@miaulalala

Copy link
Copy Markdown
Contributor

Summary

  • AccountForm unconditionally required a confirmation password when changing name/email/subscribe_to_news, but accounts created via GitHub OAuth have no usable password to confirm — so those edits always failed with "Password is required to change these fields."
  • Fixed by checking has_usable_password() before requiring/validating the confirmation password. This is more general than special-casing the github provider (mirrors the approach DeleteAccountForm already uses for GitHub, but covers any social-only login).

Test plan

  • Added GitHubOnlyAccountEditTest covering name and email changes for a GitHub-only (no usable password) account
  • poetry run python manage.py test nextcloudappstore.user.tests --settings nextcloudappstore.settings.development — all 15 tests pass

🤖 Generated with Claude Code

@edward-ly edward-ly left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While I don't think it's possible to test this in a local environment, the code makes sense. For a low impact change such as this, I think it's still fine to push this to production and try it out once it's deployed there.

And one small note, I added a # nosec in one of the user tests to suppress a false positive coming from Bandit.

@edward-ly edward-ly force-pushed the fix/github-account-password-required branch from 86d6b89 to 9d7b650 Compare July 11, 2026 00:13
AccountForm unconditionally required a confirmation password when
changing name/email, but accounts created via GitHub OAuth have no
usable password to confirm, so those edits always failed. Skip the
password requirement/check when the account has no usable password.

Signed-off-by: Anna Larch <anna@nextcloud.com>
Signed-off-by: Edward Ly <contact@edward.ly>
@edward-ly edward-ly force-pushed the fix/github-account-password-required branch from 9d7b650 to b1c97ee Compare July 11, 2026 00:19
@edward-ly edward-ly merged commit 3feb3e9 into master Jul 11, 2026
8 checks passed
@edward-ly edward-ly deleted the fix/github-account-password-required branch July 11, 2026 00:26
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