From 7cabe396710dd80bba119c6e9ff2d774c49af6e0 Mon Sep 17 00:00:00 2001 From: Prateek Sachan Date: Wed, 29 Jan 2020 18:37:18 +0530 Subject: [PATCH] Pass device_id as nil --- clientapi/routing/register.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/clientapi/routing/register.go b/clientapi/routing/register.go index b21a53893..4e50e57b9 100644 --- a/clientapi/routing/register.go +++ b/clientapi/routing/register.go @@ -531,9 +531,6 @@ func handleGuestRegistration( JSON: jsonerror.Unknown("failed to create account: " + err.Error()), } } - //we don't allow guests to specify their own device_id - deviceId := "guest_device" - token, err := tokens.GenerateLoginToken(tokens.TokenOptions{ ServerPrivateKey: cfg.Matrix.PrivateKey.Seed(), ServerName: string(acc.ServerName), @@ -546,7 +543,8 @@ func handleGuestRegistration( JSON: jsonerror.Unknown("Failed to generate access token"), } } - dev, err := deviceDB.CreateDevice(req.Context(), acc.Localpart, &deviceId, token, r.InitialDisplayName) + //we don't allow guests to specify their own device_id + dev, err := deviceDB.CreateDevice(req.Context(), acc.Localpart, nil, token, r.InitialDisplayName) if err != nil { return util.JSONResponse{ Code: http.StatusInternalServerError,