This commit is contained in:
Atridad Lahiji 2023-11-27 18:32:31 -07:00
parent d5a53dbe35
commit fd3b1234e8
No known key found for this signature in database
3 changed files with 74 additions and 70 deletions

View file

@ -8,7 +8,7 @@ export default function FourOhFour() {
return ( return (
<span className="text-center"> <span className="text-center">
<h1 className="text-5xl font-bold m-2">Error {error.status}</h1> <h1 className="text-5xl font-bold m-2">Error {error.status}</h1>
<h1 className="text-5xl font-bold m-2">{error.statusText}</h1> <h1 className="text-5xl font-bold m-2">{error.data}</h1>
<h2 className="text-2xl font-bold m-2"> <h2 className="text-2xl font-bold m-2">
If you believe you reached this page in error, please file an issue{" "} If you believe you reached this page in error, please file an issue{" "}
<a <a
@ -30,7 +30,9 @@ export default function FourOhFour() {
} else if (error instanceof Error) { } else if (error instanceof Error) {
return ( return (
<span className="text-center"> <span className="text-center">
<h1 className="text-5xl font-bold m-2">Error 500</h1> <h1 className="text-5xl font-bold m-2">Error {error.name}</h1>
<h1 className="text-3xl font-bold m-2">Error {error.message}</h1>
<h2 className="text-2xl font-bold m-2"> <h2 className="text-2xl font-bold m-2">
If you believe you reached this page in error, please file an issue{" "} If you believe you reached this page in error, please file an issue{" "}
<a <a
@ -52,8 +54,7 @@ export default function FourOhFour() {
} else { } else {
return ( return (
<span className="text-center"> <span className="text-center">
<h1 className="text-5xl font-bold m-2">Error {error.status}</h1> <h1 className="text-5xl font-bold m-2">Error 500</h1>
<h1 className="text-5xl font-bold m-2">{error.statusText}</h1>
<h2 className="text-2xl font-bold m-2"> <h2 className="text-2xl font-bold m-2">
If you believe you reached this page in error, please file an issue{" "} If you believe you reached this page in error, please file an issue{" "}
<a <a
@ -70,6 +71,7 @@ export default function FourOhFour() {
> >
Back to Home Back to Home
</Link> </Link>
</span>) </span>
);
} }
} }

View file

@ -27,7 +27,6 @@ import { useUser } from "@clerk/remix";
import { db } from "~/services/db.server"; import { db } from "~/services/db.server";
import { rooms } from "~/services/schema"; import { rooms } from "~/services/schema";
import { eq } from "drizzle-orm"; import { eq } from "drizzle-orm";
import { shitList } from "~/services/consts.server";
import FourOhFour from "~/components/FourOhFour"; import FourOhFour from "~/components/FourOhFour";
import { isShit } from "~/services/helpers.server"; import { isShit } from "~/services/helpers.server";
@ -44,21 +43,25 @@ export const loader: LoaderFunction = async (args) => {
}); });
if (!room) { if (!room) {
throw new Response(null, { throw new Response(
status: 404,
statusText:
"Oops! This room does not appear to exist, or may have been deleted!", "Oops! This room does not appear to exist, or may have been deleted!",
}); {
status: 404,
statusText: "NOT FOUND",
}
);
} }
const email = sessionClaims.email as string; const email = sessionClaims.email as string;
const shit = isShit(email);
if (isShit(email)) { if (shit) {
throw new Response(null, { throw new Response(
status: 404,
statusText:
"Wowee zowee! I'm sure I put that room around here somewhere...", "Wowee zowee! I'm sure I put that room around here somewhere...",
}); {
status: 404,
statusText: "NOT FOUND",
}
);
} }
return {}; return {};

View file

@ -1 +0,0 @@
export const shitList = ["ama.ab.ca"];