Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add missing auth check to hammer page
  • Loading branch information
regalijan committed Oct 19, 2023
1 parent b0ec692 commit 02c16c7
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions app/routes/hammer.tsx
Expand Up @@ -10,15 +10,29 @@ import {
Input,
Stack,
StackDivider,
Text,
Text
} from "@chakra-ui/react";
import { type FormEvent, useState } from "react";

export async function loader({ context }: { context: RequestContext }) {
const { current_user: currentUser } = context.data;

if (!currentUser)
throw new Response(null, {
status: 401
});

if (!(currentUser & 1 << 5))
throw new Response(null, {
status: 403
});
}

export function meta() {
return [{ title: "Hammer - Car Crushers" }];
}

export default function () {
export default function() {
const [username, setUsername] = useState("");
const [uid, setUid] = useState("");
const [status, setStatus] = useState("");
Expand Down

0 comments on commit 02c16c7

Please sign in to comment.