forked from lda/telodendria
More work on registration endpoint.
This commit is contained in:
parent
d48b6fc456
commit
abb4a9cf20
2 changed files with 30 additions and 0 deletions
8
TODO.txt
8
TODO.txt
|
@ -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
|
||||
-----------------
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue