Add some more type hints.
parent
713b590ffc
commit
49290da903
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue