mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-03 00:14:54 -04:00
Return m.change_password.enabled=false if local database is disabled (#9588)
Instead of if the user does not have a password hash. This allows a SSO user to add a password to their account, but only if the local password database is configured.
This commit is contained in:
parent
e3bc0e6f7c
commit
8000cf1315
4 changed files with 58 additions and 15 deletions
|
@ -886,6 +886,19 @@ class AuthHandler(BaseHandler):
|
|||
)
|
||||
return result
|
||||
|
||||
def can_change_password(self) -> bool:
|
||||
"""Get whether users on this server are allowed to change or set a password.
|
||||
|
||||
Both `config.password_enabled` and `config.password_localdb_enabled` must be true.
|
||||
|
||||
Note that any account (even SSO accounts) are allowed to add passwords if the above
|
||||
is true.
|
||||
|
||||
Returns:
|
||||
Whether users on this server are allowed to change or set a password
|
||||
"""
|
||||
return self._password_enabled and self._password_localdb_enabled
|
||||
|
||||
def get_supported_login_types(self) -> Iterable[str]:
|
||||
"""Get a the login types supported for the /login API
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue