summary refs log tree commit diff
path: root/synapse/handlers/auth.py
diff options
context:
space:
mode:
authorBrendan Abolivier <babolivier@matrix.org>2021-06-23 09:49:14 +0100
committerBrendan Abolivier <babolivier@matrix.org>2021-06-23 09:49:14 +0100
commit6f4c860c563f801bb6e4d14bfb292af5cce4c896 (patch)
tree8add97e6dbafe664530f85fee06dbfe60454b476 /synapse/handlers/auth.py
parentMerge remote-tracking branch 'origin/develop' into matrix-org-hotfixes (diff)
parent 1.37.0rc1 (diff)
downloadsynapse-6f4c860c563f801bb6e4d14bfb292af5cce4c896.tar.xz
Merge branch 'release-v1.37' of github.com:matrix-org/synapse into matrix-org-hotfixes
Diffstat (limited to 'synapse/handlers/auth.py')
-rw-r--r--synapse/handlers/auth.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/synapse/handlers/auth.py b/synapse/handlers/auth.py

index 8a6666a4ad..1971e373ed 100644 --- a/synapse/handlers/auth.py +++ b/synapse/handlers/auth.py
@@ -302,6 +302,7 @@ class AuthHandler(BaseHandler): request: SynapseRequest, request_body: Dict[str, Any], description: str, + can_skip_ui_auth: bool = False, ) -> Tuple[dict, Optional[str]]: """ Checks that the user is who they claim to be, via a UI auth. @@ -320,6 +321,10 @@ class AuthHandler(BaseHandler): description: A human readable string to be displayed to the user that describes the operation happening on their account. + can_skip_ui_auth: True if the UI auth session timeout applies this + action. Should be set to False for any "dangerous" + actions (e.g. deactivating an account). + Returns: A tuple of (params, session_id). @@ -343,7 +348,7 @@ class AuthHandler(BaseHandler): """ if not requester.access_token_id: raise ValueError("Cannot validate a user without an access token") - if self._ui_auth_session_timeout: + if can_skip_ui_auth and self._ui_auth_session_timeout: last_validated = await self.store.get_access_token_last_validated( requester.access_token_id )