Give guest users a device_id

We need to create devices for guests so that they can use e2e, but we don't
have anywhere to store it, so just use a fixed one.
This commit is contained in:
Richard van der Hoff 2016-11-25 15:25:30 +00:00
parent d4a459f7cb
commit 7f02e4d008
2 changed files with 20 additions and 5 deletions

View file

@ -39,6 +39,9 @@ AuthEventTypes = (
EventTypes.ThirdPartyInvite,
)
# guests always get this device id.
GUEST_DEVICE_ID = "guest_device"
class Auth(object):
"""
@ -728,7 +731,8 @@ class Auth(object):
"user": user,
"is_guest": True,
"token_id": None,
"device_id": None,
# all guests get the same device id
"device_id": GUEST_DEVICE_ID,
}
elif rights == "delete_pusher":
# We don't store these tokens in the database