Add some more type hints.

pull/8765/head
Patrick Cloke 2020-11-16 14:22:54 -05:00
parent 713b590ffc
commit 49290da903
3 changed files with 7 additions and 7 deletions

View File

@ -865,11 +865,11 @@ class OidcHandler(BaseHandler):
remote_user_id = str(remote_user_id)
# first of all, check if we already have a mapping for this user
registered_user_id = await self._sso_handler.get_sso_user_by_remote_user_id(
previously_registered_user_id = await self._sso_handler.get_sso_user_by_remote_user_id(
self._auth_provider_id, remote_user_id,
)
if registered_user_id:
return registered_user_id
if previously_registered_user_id:
return previously_registered_user_id
# Otherwise, generate a new user.
try:

View File

@ -250,11 +250,11 @@ class SamlHandler(BaseHandler):
with (await self._mapping_lock.queue(self._auth_provider_id)):
# first of all, check if we already have a mapping for this user
registered_user_id = await self._sso_handler.get_sso_user_by_remote_user_id(
previously_registered_user_id = await self._sso_handler.get_sso_user_by_remote_user_id(
self._auth_provider_id, remote_user_id,
)
if registered_user_id:
return registered_user_id
if previously_registered_user_id:
return previously_registered_user_id
# backwards-compatibility hack: see if there is an existing user with a
# suitable mapping from the uid

View File

@ -392,7 +392,7 @@ class HomeServer(metaclass=abc.ABCMeta):
return FollowerTypingHandler(self)
@cache_in_self
def get_sso_handler(self):
def get_sso_handler(self) -> SsoHandler:
return SsoHandler(self)
@cache_in_self