diff options
author | Brendan Abolivier <babolivier@matrix.org> | 2022-09-29 14:23:24 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-29 15:23:24 +0200 |
commit | be76cd8200b18f3c68b895f85ac7ef5b0ddc2466 (patch) | |
tree | c32c1b1e7a835b9f970fc4ae28ded0dd858ff841 /synapse/handlers/auth.py | |
parent | Explicit cast to enforce type hints. (#13939) (diff) | |
download | synapse-be76cd8200b18f3c68b895f85ac7ef5b0ddc2466.tar.xz |
Allow admins to require a manual approval process before new accounts can be used (using MSC3866) (#13556)
Diffstat (limited to 'synapse/handlers/auth.py')
-rw-r--r-- | synapse/handlers/auth.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/synapse/handlers/auth.py b/synapse/handlers/auth.py index eacd631ee0..f5f0e0e7a7 100644 --- a/synapse/handlers/auth.py +++ b/synapse/handlers/auth.py @@ -1009,6 +1009,17 @@ class AuthHandler: return res[0] return None + async def is_user_approved(self, user_id: str) -> bool: + """Checks if a user is approved and therefore can be allowed to log in. + + Args: + user_id: the user to check the approval status of. + + Returns: + A boolean that is True if the user is approved, False otherwise. + """ + return await self.store.is_user_approved(user_id) + async def _find_user_id_and_pwd_hash( self, user_id: str ) -> Optional[Tuple[str, str]]: |