mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-05-05 04:36:10 -05:00
* Initial * CSS lint * Test CI * Add 1v1, 2v2, and 3v3 Tags (#1771) * Initial * CSS lint * Test CI * Rename step --------- Co-authored-by: xi <104683822+ximk@users.noreply.github.com>
17 lines
479 B
TypeScript
17 lines
479 B
TypeScript
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),
|
|
};
|
|
};
|