Skip to content

Commit

Permalink
fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
odelcroi committed Dec 17, 2024
1 parent a3cc2ee commit de5db06
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions synapse_sso_proconnect/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ def __init__(
async def on_user_login(
self,
user_id: str,
auth_provider_type: str,
auth_provider_id: str
auth_provider_type: str | None,
auth_provider_id: str | None
) -> None:
logger.info("onLogin callback %s, %s, %s", user_id, auth_provider_type, auth_provider_id)

Expand All @@ -56,7 +56,11 @@ async def on_user_login(
# make the substitution
await self.substitute_threepid(user_id, current_threepid_email, oidc_email)

async def substitute_threepid(self,user_id, current_threepid_email, new_threepid_email) -> None:
async def substitute_threepid(
self,
user_id:str,
current_threepid_email:str,
new_threepid_email:str) -> None:
"""
Delete current threepid email and add a new threepid in synapse and sydent
"""
Expand Down
2 changes: 1 addition & 1 deletion synapse_sso_proconnect/proconnect_mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ async def map_user_attributes(
display_name=display_name,
)

async def get_extra_attributes(self, userinfo, token) -> JsonDict:
async def get_extra_attributes(self, userinfo: UserInfo, token: Token) -> JsonDict:
oidc_email = userinfo.email
_, current_threepid_email = await self.search_user_id_by_threepid(oidc_email)
return {"current_threepid_email":current_threepid_email, "oidc_email":oidc_email}
Expand Down

0 comments on commit de5db06

Please sign in to comment.