From c897dc51a5cf422ad2c94b6abadba09c64d7e8f2 Mon Sep 17 00:00:00 2001 From: Fenris Wolf Date: Thu, 26 Sep 2024 19:01:05 +0200 Subject: [PATCH] =?UTF-8?q?[mod]=20auth-Kram=20f=C3=BCr=20OIDC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/logic/backend.ts | 6 +++--- source/logic/conf.ts | 17 ++++++++++++++++- source/pages/login/logic.ts | 3 +++ 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/source/logic/backend.ts b/source/logic/backend.ts index 6ae5b70..be323db 100644 --- a/source/logic/backend.ts +++ b/source/logic/backend.ts @@ -171,13 +171,13 @@ namespace _zeitbild.frontend_web.backend /** */ export async function session_prepare( + input : any ) : Promise<{kind : string; data : any;}> { return call( - lib_plankton.http.enum_method.get, + lib_plankton.http.enum_method.post, "/session/prepare", - { - } + input ); } diff --git a/source/logic/conf.ts b/source/logic/conf.ts index c2b89ac..dbc7950 100644 --- a/source/logic/conf.ts +++ b/source/logic/conf.ts @@ -42,7 +42,22 @@ namespace _zeitbild.frontend_web.conf ], "additionalProperties": false, "default": {} - } + }, + "misc": { + "nullable": false, + "type": "object", + "properties": { + "oidc_redirect_uri_template": { + "nullable": true, + "type": "string", + "default": "http://localhost:8888/#oidc_finish,session_key={{session_key}}" + }, + }, + "required": [ + ], + "additionalProperties": false, + "default": {} + }, }, "required": [ "version", diff --git a/source/pages/login/logic.ts b/source/pages/login/logic.ts index e1af974..9d0c6ab 100644 --- a/source/pages/login/logic.ts +++ b/source/pages/login/logic.ts @@ -7,6 +7,9 @@ namespace _zeitbild.frontend_web.pages "login", async (parameters, target_element) => { const preparation : {kind : string; data : any;} = await _zeitbild.frontend_web.backend.session_prepare( + { + "oidc_redirect_uri_template": _zeitbild.frontend_web.conf.get()["misc"]["oidc_redirect_uri_template"], + } ); switch (preparation.kind) { case "internal": {