From 8806c38320abe306b60384327fbe1ad2830f076b Mon Sep 17 00:00:00 2001 From: M1000fr Date: Mon, 25 Nov 2024 17:30:44 +0100 Subject: [PATCH] ref: move to auth page to an component --- src/app/{auth/page.tsx => components/Auth.tsx} | 6 +++--- src/app/page.tsx | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) rename src/app/{auth/page.tsx => components/Auth.tsx} (84%) diff --git a/src/app/auth/page.tsx b/src/app/components/Auth.tsx similarity index 84% rename from src/app/auth/page.tsx rename to src/app/components/Auth.tsx index fa56f3c..73d1601 100644 --- a/src/app/auth/page.tsx +++ b/src/app/components/Auth.tsx @@ -1,7 +1,7 @@ "use client" import { signIn, signOut, useSession } from "next-auth/react"; -const LoginPage = () => { +const Auth = () => { const { data: session } = useSession(); return ( @@ -26,7 +26,7 @@ const LoginPage = () => { borderRadius: "5px", cursor: "pointer", }} - onClick={() => signIn("discord")} // Modifier selon votre provider + onClick={() => signIn("discord")} > Sign in with Discord @@ -53,4 +53,4 @@ const LoginPage = () => { ); }; -export default LoginPage; +export default Auth; diff --git a/src/app/page.tsx b/src/app/page.tsx index e64e3f6..1473b0f 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,10 +1,11 @@ "use client"; +import Auth from "./components/Auth"; import FetchWithSession from "./components/FetchWithSession"; export default function Home() { return ( <> -

Home

+ );