From ce6d483135a3d7c5ca4a01a55d25180f8b5dc10b Mon Sep 17 00:00:00 2001 From: Jordan Bancino Date: Wed, 1 Mar 2023 19:03:42 +0000 Subject: [PATCH] Implement static login page. --- TODO.txt | 2 +- src/Db.c | 2 +- src/Static/StaticLogin.c | 88 +++++++++++++++++++++++++++++++++++++++- src/Uia.c | 3 +- src/include/Db.h | 2 +- 5 files changed, 92 insertions(+), 5 deletions(-) diff --git a/TODO.txt b/TODO.txt index d5f2d97..5cc50a9 100644 --- a/TODO.txt +++ b/TODO.txt @@ -23,7 +23,7 @@ Milestone: v0.2.0 [x] Logout [x] Delete refresh token if present [ ] Logout all - [~] Login fallback (static HTML page) + [x] Login fallback (static HTML page) [~] User Interactive [x] Passwords [x] Caller builds flows diff --git a/src/Db.c b/src/Db.c index aa393df..28f9a3f 100644 --- a/src/Db.c +++ b/src/Db.c @@ -795,7 +795,7 @@ DbExists(Db * db, size_t nArgs,...) } Array * -DbList(Db *db, size_t nArgs, ...) +DbList(Db * db, size_t nArgs,...) { Array *result; diff --git a/src/Static/StaticLogin.c b/src/Static/StaticLogin.c index 6383d9f..fe97829 100644 --- a/src/Static/StaticLogin.c +++ b/src/Static/StaticLogin.c @@ -39,15 +39,101 @@ StaticLogin(FILE * stream) "
" "" "" + "" + "

" "" ); fprintf(stream, "" diff --git a/src/Uia.c b/src/Uia.c index 2a6f64a..d52cb7e 100644 --- a/src/Uia.c +++ b/src/Uia.c @@ -411,7 +411,8 @@ UiaComplete(Array * flows, HttpServerContext * context, Db * db, ArrayAdd(completed, JsonValueString(authType)); - ret = 1; /* TODO: Only return 1 if there are remaining stages */ + ret = 1; /* TODO: Only return 1 if there are + * remaining stages */ finish: ArrayFree(possibleNext); diff --git a/src/include/Db.h b/src/include/Db.h index 1096b74..6934263 100644 --- a/src/include/Db.h +++ b/src/include/Db.h @@ -58,7 +58,7 @@ extern int DbExists(Db *, size_t,...); extern Array * - DbList(Db *, size_t, ...); + DbList(Db *, size_t,...); extern HashMap * DbJson(DbRef *);