mirror of
https://github.com/kmc7468/arkvault.git
synced 2025-12-14 22:08:45 +00:00
15 lines
538 B
TypeScript
15 lines
538 B
TypeScript
import { error, json } from "@sveltejs/kit";
|
|
import { authenticate } from "$lib/server/modules/auth";
|
|
import { getUserClientStatus } from "$lib/server/services/client";
|
|
import type { RequestHandler } from "@sveltejs/kit";
|
|
|
|
export const GET: RequestHandler = async ({ cookies }) => {
|
|
const { userId, clientId } = authenticate(cookies);
|
|
if (!clientId) {
|
|
error(403, "Forbidden");
|
|
}
|
|
|
|
const { state, isInitialMekNeeded } = await getUserClientStatus(userId, clientId);
|
|
return json({ id: clientId, state, isInitialMekNeeded });
|
|
};
|