forked from lda/telodendria
Username is technically optional.
This commit is contained in:
parent
70c3d01125
commit
c15895ae06
1 changed files with 10 additions and 15 deletions
|
@ -89,21 +89,16 @@ ROUTE_IMPL(RouteRegister, args)
|
||||||
}
|
}
|
||||||
|
|
||||||
val = HashMapGet(request, "username");
|
val = HashMapGet(request, "username");
|
||||||
if (!val)
|
if (val)
|
||||||
{
|
{
|
||||||
HttpResponseStatus(args->context, HTTP_BAD_REQUEST);
|
|
||||||
response = MatrixErrorCreate(M_MISSING_PARAM);
|
|
||||||
goto finish;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (JsonValueType(val) != JSON_STRING)
|
if (JsonValueType(val) != JSON_STRING)
|
||||||
{
|
{
|
||||||
HttpResponseStatus(args->context, HTTP_BAD_REQUEST);
|
HttpResponseStatus(args->context, HTTP_BAD_REQUEST);
|
||||||
response = MatrixErrorCreate(M_BAD_JSON);
|
response = MatrixErrorCreate(M_BAD_JSON);
|
||||||
goto finish;
|
goto finish;
|
||||||
}
|
}
|
||||||
|
|
||||||
username = JsonValueAsString(val);
|
username = JsonValueAsString(val);
|
||||||
|
}
|
||||||
|
|
||||||
val = HashMapGet(request, "password");
|
val = HashMapGet(request, "password");
|
||||||
if (!val)
|
if (!val)
|
||||||
|
@ -177,12 +172,12 @@ ROUTE_IMPL(RouteRegister, args)
|
||||||
/* TODO: Register new user here */
|
/* TODO: Register new user here */
|
||||||
|
|
||||||
/* These values are already set */
|
/* These values are already set */
|
||||||
(void) username;
|
|
||||||
(void) password;
|
(void) password;
|
||||||
(void) refreshToken;
|
(void) refreshToken;
|
||||||
(void) inhibitLogin;
|
(void) inhibitLogin;
|
||||||
|
|
||||||
/* These may be NULL */
|
/* These may be NULL */
|
||||||
|
(void) username;
|
||||||
(void) deviceId;
|
(void) deviceId;
|
||||||
(void) initialDeviceDisplayName;
|
(void) initialDeviceDisplayName;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue