fix: disable password change when password auth is disabled#2546
fix: disable password change when password auth is disabled#2546xingzihai wants to merge 1 commit intokarakeep-app:mainfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (3)
WalkthroughThis PR adds configuration-driven password authentication disabling. It includes a frontend UI component guard to conditionally hide the password change form, a backend mutation guard to reject password changes when disabled, and test coverage validating this behavior. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). 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. Comment |
Greptile SummaryThis PR successfully prevents password changes when password authentication is disabled, fixing issue #784. Major changes:
The implementation is clean and follows existing patterns in the codebase (similar to how Confidence Score: 5/5
Important Files Changed
Last reviewed commit: ca378d5 |
|
Thanks for the PR! I think it's fine the keep the password form when password auth is disabled. Maybe instead, we can just hide it if the user is |
Summary
Fixes #784 by making password-change behavior consistent with auth config when password login is disabled.
Root Cause
users.changePasswordcould still be called even whenauth.disablePasswordAuth=true, and the settings UI still rendered the Change Password section.Changes
ChangePasswordsettings section whendisablePasswordAuthis enabled.users.changePasswordto reject withFORBIDDENwhen password auth is disabled.changePasswordthrows when password auth is disabled.Verification
typecheck,lint,format).packages/trpc/routers/users.test.ts.Risk
Low. Small, issue-scoped change with explicit backend guard + test coverage.
Rollback
Revert commit
ca378d5e15e5658d449595fcef0c8db19d892c49.