0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-27 07:54:05 +01:00

modules/client/login: Fix for fully qualified requested device_id; verify hostpart.

This commit is contained in:
Jason Volk 2020-04-15 17:28:22 -07:00
parent 6eb1724a2b
commit d1a5930ba9

View file

@ -114,11 +114,19 @@ post__login_password(client &client,
const auto device_id
{
valid(m::id::DEVICE, requested_device_id)?
m::id::device::buf{requested_device_id}:
requested_device_id?
m::id::device::buf{requested_device_id, my_host()}:
m::id::device::buf{m::id::generate, my_host()}
};
if(!my(device_id))
throw m::UNSUPPORTED
{
"Device ID's with foreign hostparts are not supported."
};
char access_token_buf[32];
const string_view access_token
{