mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-08-07 09:22:13 -04:00
Allow re-using a UI auth validation for a period of time (#8970)
This commit is contained in:
parent
4136255d3c
commit
5d4c330ed9
10 changed files with 193 additions and 49 deletions
|
@ -254,14 +254,18 @@ class PasswordRestServlet(RestServlet):
|
|||
logger.error("Auth succeeded but no known type! %r", result.keys())
|
||||
raise SynapseError(500, "", Codes.UNKNOWN)
|
||||
|
||||
# If we have a password in this request, prefer it. Otherwise, there
|
||||
# must be a password hash from an earlier request.
|
||||
# If we have a password in this request, prefer it. Otherwise, use the
|
||||
# password hash from an earlier request.
|
||||
if new_password:
|
||||
password_hash = await self.auth_handler.hash(new_password)
|
||||
else:
|
||||
elif session_id is not None:
|
||||
password_hash = await self.auth_handler.get_session_data(
|
||||
session_id, "password_hash", None
|
||||
)
|
||||
else:
|
||||
# UI validation was skipped, but the request did not include a new
|
||||
# password.
|
||||
password_hash = None
|
||||
if not password_hash:
|
||||
raise SynapseError(400, "Missing params: password", Codes.MISSING_PARAM)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue