summary refs log tree commit diff
path: root/synapse/handlers/set_password.py
diff options
context:
space:
mode:
authorDirk Klimpel <5740567+dklimpel@users.noreply.github.com>2020-03-26 17:51:13 +0100
committerGitHub <noreply@github.com>2020-03-26 16:51:13 +0000
commite8e2ddb60ae11db488f159901d918cb159695912 (patch)
tree11a1e2c0187b30e8c969bb3e695e1416f2d2a579 /synapse/handlers/set_password.py
parentValidate that the session is not modified during UI-Auth (#7068) (diff)
downloadsynapse-e8e2ddb60ae11db488f159901d918cb159695912.tar.xz
Allow server admins to define and enforce a password policy (MSC2000). (#7118)
Diffstat (limited to 'synapse/handlers/set_password.py')
-rw-r--r--synapse/handlers/set_password.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/synapse/handlers/set_password.py b/synapse/handlers/set_password.py
index 12657ca698..7d1263caf2 100644
--- a/synapse/handlers/set_password.py
+++ b/synapse/handlers/set_password.py
@@ -32,6 +32,7 @@ class SetPasswordHandler(BaseHandler):
         super(SetPasswordHandler, self).__init__(hs)
         self._auth_handler = hs.get_auth_handler()
         self._device_handler = hs.get_device_handler()
+        self._password_policy_handler = hs.get_password_policy_handler()
 
     @defer.inlineCallbacks
     def set_password(
@@ -44,6 +45,7 @@ class SetPasswordHandler(BaseHandler):
         if not self.hs.config.password_localdb_enabled:
             raise SynapseError(403, "Password change disabled", errcode=Codes.FORBIDDEN)
 
+        self._password_policy_handler.validate_password(new_password)
         password_hash = yield self._auth_handler.hash(new_password)
 
         try: