2023-10-02 16:20:13 -04:00
|
|
|
import { H3Event, EventHandlerRequest } from "h3";
|
2023-10-03 00:50:00 -04:00
|
|
|
import { messages } from "../constants";
|
2023-10-02 16:20:13 -04:00
|
|
|
export default function (ev: H3Event<EventHandlerRequest>) {
|
|
|
|
if (!ev.context.currentUser) {
|
|
|
|
throw createError({
|
|
|
|
statusCode: 401,
|
2023-10-03 00:50:00 -04:00
|
|
|
statusMessage: messages[401],
|
2023-10-02 16:20:13 -04:00
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|