diff --git a/TODO.txt b/TODO.txt index 3d271ef..b2e7b01 100644 --- a/TODO.txt +++ b/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 ----------------- diff --git a/src/Routes/RouteRegister.c b/src/Routes/RouteRegister.c index e9b030f..c479173 100644 --- a/src/Routes/RouteRegister.c +++ b/src/Routes/RouteRegister.c @@ -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);