backend/source/api/actions/session_prepare.ts

42 lines
796 B
TypeScript
Raw Normal View History

2024-09-13 17:49:32 +02:00
namespace _zeitbild.api
{
/**
*/
export function register_session_prepare(
2024-10-30 07:20:13 +01:00
rest_subject : lib_plankton.rest_caldav.type_rest
2024-09-13 17:49:32 +02:00
) : void
{
2024-10-30 07:20:13 +01:00
lib_plankton.rest_caldav.register<
any,
2024-09-18 18:17:25 +02:00
{
kind : string;
data : any;
}
2024-09-13 17:49:32 +02:00
>(
rest_subject,
lib_plankton.http.enum_method.post,
2024-09-13 17:49:32 +02:00
"/session/prepare",
{
2024-11-28 23:08:24 +01:00
"description": () => "gibt die nötigen Werkzeuge für eine Anmeldung aus",
2024-09-13 17:49:32 +02:00
"input_schema": () => ({
"nullable": true,
}),
"output_schema": () => ({
2024-09-18 18:17:25 +02:00
"nullable": false
2024-09-13 17:49:32 +02:00
}),
2024-11-28 23:08:24 +01:00
"restriction": () => restriction_none,
"execution": () => async (stuff) => {
const preparation = await _zeitbild.auth.prepare(stuff.input);
2024-09-18 18:17:25 +02:00
return Promise.resolve({
"status_code": 200,
"data": preparation,
});
2024-09-13 17:49:32 +02:00
},
}
);
}
}