mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 22:14:55 -04:00
SYN-48: Track User-Agents as well as IPs for client devices.
This commit is contained in:
parent
0fdf308874
commit
f7d80930f2
4 changed files with 20 additions and 5 deletions
|
@ -223,8 +223,17 @@ class Auth(object):
|
|||
user = yield self.get_user_by_token(access_token)
|
||||
|
||||
ip_addr = self.hs.get_ip_from_request(request)
|
||||
user_agent = request.requestHeaders.getRawHeaders(
|
||||
"User-Agent",
|
||||
default=[""]
|
||||
)[0]
|
||||
if user and access_token and ip_addr:
|
||||
self.store.insert_client_ip(user, access_token, ip_addr)
|
||||
self.store.insert_client_ip(
|
||||
user,
|
||||
access_token,
|
||||
ip_addr,
|
||||
user_agent
|
||||
)
|
||||
|
||||
defer.returnValue(user)
|
||||
except KeyError:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue