summary refs log tree commit diff
path: root/synapse/handlers/auth.py
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2021-04-20 17:42:58 +0100
committerAndrew Morgan <andrew@amorgan.xyz>2021-04-20 17:42:58 +0100
commit995136eb38340454d85c72a2c1295ffa3af01892 (patch)
tree57f8eb47677daf8bfb8d56dcfc95eb05ea0635f9 /synapse/handlers/auth.py
parentMerge commit 'c9c1c9d82' into anoa/dinsic_release_1_31_0 (diff)
parentMerge remote-tracking branch 'origin/erikj/as_mau_block' into develop (diff)
downloadsynapse-995136eb38340454d85c72a2c1295ffa3af01892.tar.xz
Merge commit 'a7a913918' into anoa/dinsic_release_1_31_0
Diffstat (limited to 'synapse/handlers/auth.py')
-rw-r--r--synapse/handlers/auth.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/synapse/handlers/auth.py b/synapse/handlers/auth.py

index f385c72526..acf5f8e74a 100644 --- a/synapse/handlers/auth.py +++ b/synapse/handlers/auth.py
@@ -728,6 +728,7 @@ class AuthHandler(BaseHandler): device_id: Optional[str], valid_until_ms: Optional[int], puppets_user_id: Optional[str] = None, + is_appservice_ghost: bool = False, ) -> str: """ Creates a new access token for the user with the given user ID. @@ -744,6 +745,7 @@ class AuthHandler(BaseHandler): we should always have a device ID) valid_until_ms: when the token is valid until. None for no expiry. + is_appservice_ghost: Whether the user is an application ghost user Returns: The access token for the user's session. Raises: @@ -764,7 +766,11 @@ class AuthHandler(BaseHandler): "Logging in user %s on device %s%s", user_id, device_id, fmt_expiry ) - await self.auth.check_auth_blocking(user_id) + if ( + not is_appservice_ghost + or self.hs.config.appservice.track_appservice_user_ips + ): + await self.auth.check_auth_blocking(user_id) access_token = self.macaroon_gen.generate_access_token(user_id) await self.store.add_access_token_to_user(