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

View file

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

View file

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