diff --git a/app/auth/callback/route.ts b/app/auth/callback/route.ts deleted file mode 100644 index 13dc3f7..0000000 --- a/app/auth/callback/route.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { createClient } from "@/utils/supabase/server"; -import { NextResponse } from "next/server"; -import { cookies } from "next/headers"; - -export async function GET(request: Request) { - // The `/auth/callback` route is required for the server-side auth flow implemented - // by the Auth Helpers package. It exchanges an auth code for the user's session. - // https://supabase.com/docs/guides/auth/auth-helpers/nextjs#managing-sign-in-with-code-exchange - const requestUrl = new URL(request.url); - const code = requestUrl.searchParams.get("code"); - - if (code) { - const cookieStore = cookies(); - const supabase = createClient(cookieStore); - await supabase.auth.exchangeCodeForSession(code); - } - - // URL to redirect to after sign in process completes - return NextResponse.redirect(requestUrl.origin); -} diff --git a/app/layout.tsx b/app/layout.tsx index 536fade..3844e94 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -18,11 +18,7 @@ export default function RootLayout({ }) { return ( - -
- {children} -
- + {children} ); } diff --git a/app/login/page.tsx b/app/login/page.tsx deleted file mode 100644 index ec451d1..0000000 --- a/app/login/page.tsx +++ /dev/null @@ -1,118 +0,0 @@ -import Link from "next/link"; -import { headers, cookies } from "next/headers"; -import { createClient } from "@/utils/supabase/server"; -import { redirect } from "next/navigation"; - -export default function Login({ - searchParams, -}: { - searchParams: { message: string }; -}) { - const signIn = async (formData: FormData) => { - "use server"; - - const email = formData.get("email") as string; - const password = formData.get("password") as string; - const cookieStore = cookies(); - const supabase = createClient(cookieStore); - - const { error } = await supabase.auth.signInWithPassword({ - email, - password, - }); - - if (error) { - return redirect("/login?message=Could not authenticate user"); - } - - return redirect("/"); - }; - - const signUp = async (formData: FormData) => { - "use server"; - - const origin = headers().get("origin"); - const email = formData.get("email") as string; - const password = formData.get("password") as string; - const cookieStore = cookies(); - const supabase = createClient(cookieStore); - - const { error } = await supabase.auth.signUp({ - email, - password, - options: { - emailRedirectTo: `${origin}/auth/callback`, - }, - }); - - if (error) { - return redirect("/login?message=Could not authenticate user"); - } - - return redirect("/login?message=Check email to continue sign in process"); - }; - - return ( -
- - - - {" "} - Back - - -
- - - - - - - {searchParams?.message && ( -

- {searchParams.message} -

- )} -
-
- ); -} diff --git a/app/page.tsx b/app/page.tsx index 25eaad5..a679148 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -1,25 +1,3 @@ -import { createClient } from "@/utils/supabase/server"; -import { cookies } from "next/headers"; - export default async function Index() { - const cookieStore = cookies(); - - const canInitSupabaseClient = () => { - // This function is just for the interactive tutorial. - // Feel free to remove it once you have Supabase connected. - try { - createClient(cookieStore); - return true; - } catch (e) { - return false; - } - }; - - const isSupabaseConnected = canInitSupabaseClient(); - - return ( - <> -

hello

- - ); + return <>Hello; } diff --git a/package.json b/package.json index 26a8565..5176d69 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "start": "next start" }, "dependencies": { + "@radix-ui/react-slot": "^1.0.2", "@supabase/ssr": "latest", "@supabase/supabase-js": "latest", "autoprefixer": "10.4.15", diff --git a/public/stan.jpg b/public/stan.jpg new file mode 100644 index 0000000..9437130 Binary files /dev/null and b/public/stan.jpg differ