Skip to content

Commit

Permalink
Debug
Browse files Browse the repository at this point in the history
  • Loading branch information
adb-sh committed Feb 23, 2024
1 parent 41f50de commit 157fade
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 32 deletions.
15 changes: 0 additions & 15 deletions src/components/LoginForm.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,8 @@
import { useSupabase } from "solid-supabase";
import { useNavigate, useSubmission } from "@solidjs/router";
import { createSignal, Show } from "solid-js";
import { login, register } from "~/lib";

export const LoginForm = () => {
const navigate = useNavigate();
const supabase = useSupabase();
const signIn = async () => {
const { error } = await supabase.auth.signInWithOAuth({
provider: "github",
});

if (error) {
alert(error.message);
return;
}
navigate("/cloud", { replace: true });
};

const loginStatus = useSubmission(login);
const registerStatus = useSubmission(register);

Expand Down
4 changes: 0 additions & 4 deletions src/routes/api/auth/[...solidauth].tsx

This file was deleted.

18 changes: 5 additions & 13 deletions src/routes/login.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,14 @@
import { A, Title, useRouteData } from "solid-start";
import { Show } from "solid-js";
import LoginForm from "~/components/LoginForm";
import { useSession } from "~/composables/solidauth";
import { signOut } from "@solid-auth/base/client";

export const routeData = useSession;

export const Home = () => {
const session = useRouteData<typeof useSession>();

export default () => {
return (
<main>
<Title>Login</Title>
<title>Login</title>
<section>
<h1 class="text-6xl uppercase text-center my-12">Login</h1>
<div class="flex justify-center">
<Show
{/* <Show
when={session()?.user}
fallback={LoginForm}
>
Expand All @@ -35,11 +28,10 @@ export const Home = () => {
Logout
</button>
</figure>
</Show>
</Show> */}
<LoginForm />
</div>
</section>
</main>
);
};

export default Home;

0 comments on commit 157fade

Please sign in to comment.