Timed bans feature

This commit is contained in:
Kalle
2024-04-11 20:59:05 +03:00
parent 6d68eecaae
commit 7f25bbcd78
22 changed files with 459 additions and 189 deletions

View File

@@ -0,0 +1,16 @@
import type { LoaderFunction } from "@remix-run/node";
import { redirect } from "@remix-run/node";
import { getUserId, isImpersonating } from "~/features/auth/core/user.server";
import { isMod } from "~/permissions";
export const loader: LoaderFunction = async ({ request }) => {
const user = await getUserId(request);
if (process.env.NODE_ENV === "production" && !isMod(user)) {
throw redirect("/");
}
return {
isImpersonating: await isImpersonating(request),
};
};