forked from lda/telodendria
Add username check logic
This commit is contained in:
parent
5080d066ab
commit
d48b6fc456
1 changed files with 8 additions and 0 deletions
|
@ -70,6 +70,14 @@ ROUTE_IMPL(RouteRegister, args)
|
|||
if (HttpRequestMethodGet(args->context) == HTTP_GET &&
|
||||
MATRIX_PATH_EQUALS(pathPart, "available"))
|
||||
{
|
||||
char *username = HashMapGet(HttpRequestParams(args->context), "username");
|
||||
|
||||
if (!username)
|
||||
{
|
||||
HttpResponseStatus(args->context, HTTP_BAD_REQUEST);
|
||||
response = MatrixErrorCreate(M_MISSING_PARAM);
|
||||
}
|
||||
|
||||
/* TODO: Check if ?username=x is available */
|
||||
}
|
||||
else if (HttpRequestMethodGet(args->context) == HTTP_POST &&
|
||||
|
|
Loading…
Reference in a new issue