This commit is contained in:
fenris 2025-10-02 14:30:52 +02:00
parent 49b9481701
commit 002e057d45
2 changed files with 12 additions and 7 deletions

View file

@ -65,12 +65,15 @@ namespace _zeitbild.api
}), }),
"restriction": () => restriction_none, "restriction": () => restriction_none,
"execution": () => async ({"input": input}) => { "execution": () => async ({"input": input}) => {
if (input === null) { if (input === null)
{
return Promise.reject(new Error("impossible")); return Promise.reject(new Error("impossible"));
} }
else { else
{
const passed : boolean = await _zeitbild.service.auth_internal.check(input.name, input.password); const passed : boolean = await _zeitbild.service.auth_internal.check(input.name, input.password);
if (! passed) { if (! passed)
{
return Promise.resolve({ return Promise.resolve({
"status_code": 403, "status_code": 403,
"data": null, "data": null,

View file

@ -43,10 +43,12 @@ namespace _zeitbild.api
"execution": async (stuff) => { "execution": async (stuff) => {
const session : {key : string; value : lib_plankton.session.type_session} = await session_from_stuff(stuff); const session : {key : string; value : lib_plankton.session.type_session} = await session_from_stuff(stuff);
await lib_plankton.session.end(session.key); await lib_plankton.session.end(session.key);
return Promise.resolve({ return Promise.resolve(
"status_code": 200, {
"data": null, "status_code": 200,
}); "data": null,
}
);
}, },
} }
); );