Skip to content

Commit

Permalink
require auth to view welcome screen
Browse files Browse the repository at this point in the history
  • Loading branch information
boazsender committed Feb 16, 2024
1 parent 8c1bc26 commit f1fef17
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion app/routes/welcome.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import { Dialog, Transition } from "@headlessui/react";
import { LockClosedIcon } from "@heroicons/react/20/solid";
import { ActionFunctionArgs, redirect } from "@remix-run/node";
import {
ActionFunctionArgs,
LoaderFunctionArgs,
redirect,
} from "@remix-run/node";
import { Form, Link } from "@remix-run/react";
import { Fragment, useState } from "react";

Expand All @@ -9,6 +13,11 @@ import ButtonLink from "~/components/ButtonLink";
import { deleteUserById } from "~/models/user.server";
import { requireUserId } from "~/session.server";

export const loader = async ({ request }: LoaderFunctionArgs) => {
await requireUserId(request);
return {};
};

export const action = async ({ request }: ActionFunctionArgs) => {
const userId = await requireUserId(request);
await deleteUserById(userId);
Expand Down

0 comments on commit f1fef17

Please # to comment.