diff options
author | Andrew Yasinishyn <yasinishyn.a.n@gmail.com> | 2023-12-01 16:31:50 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-01 14:31:50 +0000 |
commit | 63d96bfc61fcbf53e9607c63f215d2dde387de29 (patch) | |
tree | 59f4d2bab25d0b39e291cc1063132170f846eec9 /synapse/rest | |
parent | Drop unused tables & unneeded access token ID for events. (#16522) (diff) | |
download | synapse-63d96bfc61fcbf53e9607c63f215d2dde387de29.tar.xz |
ModuleAPI SSO auth callbacks (#15207)
Signed-off-by: Andrii Yasynyshyn yasinishyn.a.n@gmail.com
Diffstat (limited to 'synapse/rest')
-rw-r--r-- | synapse/rest/client/login.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/synapse/rest/client/login.py b/synapse/rest/client/login.py index 7be327e26f..546f042f87 100644 --- a/synapse/rest/client/login.py +++ b/synapse/rest/client/login.py @@ -115,6 +115,7 @@ class LoginRestServlet(RestServlet): self.registration_handler = hs.get_registration_handler() self._sso_handler = hs.get_sso_handler() self._spam_checker = hs.get_module_api_callbacks().spam_checker + self._account_validity_handler = hs.get_account_validity_handler() self._well_known_builder = WellKnownBuilder(hs) self._address_ratelimiter = Ratelimiter( @@ -470,6 +471,13 @@ class LoginRestServlet(RestServlet): device_id=device_id, ) + # execute the callback + await self._account_validity_handler.on_user_login( + user_id, + auth_provider_type=login_submission.get("type"), + auth_provider_id=auth_provider_id, + ) + if valid_until_ms is not None: expires_in_ms = valid_until_ms - self.clock.time_msec() result["expires_in_ms"] = expires_in_ms |