diff --git a/modules/client/login.cc b/modules/client/login.cc index b346688ca..874471a2f 100644 --- a/modules/client/login.cc +++ b/modules/client/login.cc @@ -122,14 +122,16 @@ post__login_password(client &client, }) }; - m::device::set(user_id, + const json::members device { { "device_id", device_id }, { "display_name", initial_device_display_name }, { "last_seen_ts", ircd::time() }, { "last_seen_ip", last_seen_ip }, { "access_token_id", access_token_id }, - }); + }; + + m::device::set(user_id, device); // Send response to user return resource::response diff --git a/modules/client/register.cc b/modules/client/register.cc index 9143a0649..c829e9e2b 100644 --- a/modules/client/register.cc +++ b/modules/client/register.cc @@ -334,14 +334,16 @@ register_user(const m::registar &request, }) }; - m::device::set(user_id, + const json::members device { { "device_id", device_id }, { "display_name", initial_device_display_name }, { "last_seen_ts", ircd::time() }, { "last_seen_ip", last_seen_ip }, { "access_token_id", access_token_id }, - }); + }; + + m::device::set(user_id, device); } // Send response to user