-
Fix: admin password update crashes for SSO users (500 'NoneType' object has no attribute 'split') (#16914)
发布于
2026-07-14 15:30:35 +00:00 What problem does this PR solve?
Setting a password from the admin panel for an SSO-provisioned account
(OIDC/OAuth/GitHub) returns a 500 with:'NoneType' object has no attribute 'split'Root cause — SSO-provisioned accounts have no local password, so
usr.passwordisNone(theUser.passwordcolumn isnull=True). In
UserMgr.update_user_password(admin/server/services.py), the "same
password" optimization calls:if check_password_hash(usr.password, psw):werkzeug.security.check_password_hash(None, psw)internally does
pwhash.split("$"), which raisesAttributeError: 'NoneType' object has no attribute 'split'→ surfaced as a 500.Repro
- Configure an SSO channel (OIDC/OAuth) under
oauthin the service
config. - Log in once via SSO so the account is auto-provisioned (created
without a local password). - In the admin panel, set/change that user's password.
- → 500
'NoneType' object has no attribute 'split'.
Fix — guard the equality check with
usr.password. A passwordless
(SSO) user skips the comparison and goes straight to setting the new
password, which is the desired behavior (it gives them a password
fallback in addition to SSO).Type of change
- Bug Fix (non-breaking change which fixes an issue)
Co-authored-by: Claude Opus 4.8 (1M context) noreply@anthropic.com
下载附件
- Configure an SSO channel (OIDC/OAuth) under