mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 16:44:49 -04:00
Hash passwords earlier in the password reset process (#7538)
This now matches the logic of the registration process as modified in
56db0b1365
/ #7523.
This commit is contained in:
parent
4fa74c7606
commit
9dc6f3075a
5 changed files with 33 additions and 11 deletions
|
@ -35,16 +35,13 @@ class SetPasswordHandler(BaseHandler):
|
|||
async def set_password(
|
||||
self,
|
||||
user_id: str,
|
||||
new_password: str,
|
||||
password_hash: str,
|
||||
logout_devices: bool,
|
||||
requester: Optional[Requester] = None,
|
||||
):
|
||||
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 = await self._auth_handler.hash(new_password)
|
||||
|
||||
try:
|
||||
await self.store.user_set_password_hash(user_id, password_hash)
|
||||
except StoreError as e:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue