2026-03-15 11:44:09 +01:00

12 lines
369 B
TypeScript

import {Session} from "~/auth/Session";
import {useRuntimeConfig} from "#imports";
export default defineEventHandler(async (event) =>
{
const cookie = getCookie(event, Session.COOKIE);
if (cookie == null)
{
console.log("Request is unauthorized. Redirect to IDP.");
await sendRedirect(event, useRuntimeConfig().public.idpUrl, 302);
}
});