ref: move to auth page to an component

This commit is contained in:
M1000fr 2024-11-25 17:30:44 +01:00
parent e257940129
commit 8806c38320
2 changed files with 5 additions and 4 deletions

View File

@ -1,7 +1,7 @@
"use client" "use client"
import { signIn, signOut, useSession } from "next-auth/react"; import { signIn, signOut, useSession } from "next-auth/react";
const LoginPage = () => { const Auth = () => {
const { data: session } = useSession(); const { data: session } = useSession();
return ( return (
@ -26,7 +26,7 @@ const LoginPage = () => {
borderRadius: "5px", borderRadius: "5px",
cursor: "pointer", cursor: "pointer",
}} }}
onClick={() => signIn("discord")} // Modifier selon votre provider onClick={() => signIn("discord")}
> >
Sign in with Discord Sign in with Discord
</button> </button>
@ -53,4 +53,4 @@ const LoginPage = () => {
); );
}; };
export default LoginPage; export default Auth;

View File

@ -1,10 +1,11 @@
"use client"; "use client";
import Auth from "./components/Auth";
import FetchWithSession from "./components/FetchWithSession"; import FetchWithSession from "./components/FetchWithSession";
export default function Home() { export default function Home() {
return ( return (
<> <>
<h1>Home</h1> <Auth />
<FetchWithSession /> <FetchWithSession />
</> </>
); );