Skip to content

Commit

Permalink
Disable email signup
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderson1993 committed Jan 8, 2025
1 parent b949146 commit 9c580f2
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions app/routes/signUp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { FaSpinner } from "react-icons/fa";
import { Input } from "~/components/Input";
import { validateCredentials } from "~/helpers/validateCredentials";
import {
ActionFunction,
LoaderFunction,
type ActionFunction,
type LoaderFunction,
redirect,
} from "@remix-run/server-runtime";
import { json } from "remix-utils";
Expand All @@ -16,15 +16,15 @@ interface SignUpSubmitResults {
displayName?: string;
}

export let loader: LoaderFunction = async ({ request }) => {
let session = await getSession(request);
export const loader: LoaderFunction = async ({ request }) => {
const session = await getSession(request);

if (session.has("user")) {
// Redirect to the home page if they are already signed in.
return redirect("/");
}

let data = {
const data = {
error: session.get("error"),
email: session.get("email"),
displayName: session.get("displayName"),
Expand All @@ -37,9 +37,9 @@ export let loader: LoaderFunction = async ({ request }) => {
});
};

export let action: ActionFunction = async ({ request }) => {
let session = await getSession(request);
let bodyParams = new URLSearchParams(await request.text());
export const action: ActionFunction = async ({ request }) => {
const session = await getSession(request);
const bodyParams = new URLSearchParams(await request.text());
const email = bodyParams.get("email");
const displayName = bodyParams.get("displayName");
try {
Expand Down Expand Up @@ -74,8 +74,8 @@ export let action: ActionFunction = async ({ request }) => {
};

export default function SignUp() {
let { error, email, displayName } = useLoaderData<SignUpSubmitResults>();
let pendingForm = useTransition().submission;
const { error, email, displayName } = useLoaderData<SignUpSubmitResults>();
const pendingForm = useTransition().submission;
return (
<div className="mt-32 flex min-h-full w-full flex-col items-center justify-center">
<div className="w-full max-w-xl flex-1 px-4">
Expand All @@ -86,7 +86,7 @@ export default function SignUp() {
className="mb-16 flex flex-col rounded bg-tgray-500 bg-opacity-50 px-8 pt-6 pb-8 shadow-md"
method="post"
>
<Input
{/** <Input
label="Display Name"
type="text"
name="displayName"
Expand Down Expand Up @@ -119,6 +119,8 @@ export default function SignUp() {
{pendingForm ? <FaSpinner className="animate-spin" /> : "Sign In"}
</button>
</div>
*/}
<p>Email address signup is disabled.</p>
<hr className="mx-auto my-8 w-1/2" />
<p className="text-center">
Have an account?{" "}
Expand Down

0 comments on commit 9c580f2

Please sign in to comment.