More work on registration endpoint.

This commit is contained in:
Jordan Bancino 2022-12-15 01:48:49 +00:00
parent d48b6fc456
commit abb4a9cf20
2 changed files with 30 additions and 0 deletions

View file

@ -8,6 +8,14 @@ Key:
[~] In Progress
[!] Won't Fix
Milestone: v0.1.1
-----------------
[ ] DbDelete()
[ ] UtilRandomString()
[ ] Database version file
[ ] User registration
Milestone: v1.0.0
-----------------

View file

@ -39,6 +39,7 @@ ROUTE_IMPL(RouteRegister, args)
if (MATRIX_PATH_PARTS(args->path) == 0)
{
HashMap *auth = NULL;
if (HttpRequestMethodGet(args->context) != HTTP_POST)
{
@ -59,6 +60,27 @@ ROUTE_IMPL(RouteRegister, args)
return MatrixErrorCreate(M_NOT_JSON);
}
auth = HashMapGet(request, "auth");
if (!auth)
{
Array *flows = ArrayCreate();
HashMap *dummyFlow = HashMapCreate();
Array *stages = ArrayCreate();
response = HashMapCreate();
ArrayAdd(stages, JsonValueString(UtilStringDuplicate("m.login.dummy")));
HashMapSet(dummyFlow, "stages", JsonValueArray(stages));
ArrayAdd(flows, JsonValueObject(dummyFlow));
HashMapSet(response, "flows", JsonValueArray(flows));
HashMapSet(response, "params", JsonValueObject(HashMapCreate()));
}
else
{
}
/* TODO: Complete account registration flow */
JsonFree(request);