Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Rename get_refresh_token_for_user_id to create_refresh_token_for_user_id #11370

Merged
merged 1 commit into from
Nov 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/11370.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Rename `get_refresh_token_for_user_id` to `create_refresh_token_for_user_id` to better describe what it does.
4 changes: 2 additions & 2 deletions synapse/handlers/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,7 @@ async def refresh_token(
(
new_refresh_token,
new_refresh_token_id,
) = await self.get_refresh_token_for_user_id(
) = await self.create_refresh_token_for_user_id(
user_id=existing_token.user_id, device_id=existing_token.device_id
)
access_token = await self.get_access_token_for_user_id(
Expand Down Expand Up @@ -832,7 +832,7 @@ def _verify_refresh_token(self, token: str) -> bool:

return True

async def get_refresh_token_for_user_id(
async def create_refresh_token_for_user_id(
self,
user_id: str,
device_id: str,
Expand Down
2 changes: 1 addition & 1 deletion synapse/handlers/register.py
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,7 @@ class and RegisterDeviceReplicationServlet.
(
refresh_token,
refresh_token_id,
) = await self._auth_handler.get_refresh_token_for_user_id(
) = await self._auth_handler.create_refresh_token_for_user_id(
user_id,
device_id=registered_device_id,
)
Expand Down