From 748aa0e120a0a90af3b9fc6d7874d6ba40a33a72 Mon Sep 17 00:00:00 2001 From: regalijan Date: Fri, 20 Oct 2023 10:07:55 -0400 Subject: [PATCH] Create session check endpoint --- functions/api/auth/mobile/is-valid.ts | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 functions/api/auth/mobile/is-valid.ts diff --git a/functions/api/auth/mobile/is-valid.ts b/functions/api/auth/mobile/is-valid.ts new file mode 100644 index 0000000..bd0d726 --- /dev/null +++ b/functions/api/auth/mobile/is-valid.ts @@ -0,0 +1,7 @@ +import { jsonResponse } from "../../../common.js"; + +export async function onRequestGet(context: RequestContext) { + return jsonResponse( + JSON.stringify({ valid: Boolean(context.data.current_user) }), + ); +}