added oauth Route

This commit is contained in:
PxlLoewe
2025-02-02 19:42:42 +01:00
parent 29f9cd7941
commit edcad748fb
23 changed files with 799 additions and 161 deletions

View File

@@ -1,11 +1,11 @@
'use client';
import { useSession } from 'next-auth/react';
import Link from 'next/link';
import { useEffect } from 'react';
export default function Home() {
const { data: session, status, update } = useSession();
console.log(session, status);
const { data: session, update } = useSession();
useEffect(() => {
update();
}, []);
@@ -14,6 +14,9 @@ export default function Home() {
<h1 className="text-5xl">Hub</h1>
{!session && <h2 className="text-error text-xl">Not signed in</h2>}
{session?.user?.firstname && <h1>Hi, {session?.user?.firstname}</h1>}
<Link href="/logout">
<button className="btn">Logout</button>
</Link>
</div>
);
}