next/lib/server/middlewareButNotReally/isLoggedIn.ts

10 lines
242 B
TypeScript
Raw Normal View History

import { H3Event, EventHandlerRequest } from "h3";
export default function (ev: H3Event<EventHandlerRequest>) {
if (!ev.context.currentUser) {
throw createError({
statusCode: 401,
statusMessage: "Authentication required",
});
}
}