silverwolf-x's picture
download
raw
814 Bytes
import { auth, signIn, signOut } from "@/auth";
function SignIn() {
return (
<form
action={async () => {
"use server";
await signIn("github");
}}
>
<p>You are not logged in</p>
<button type="submit">Sign in with GitHub</button>
</form>
);
}
function SignOut({ children }: { children: React.ReactNode }) {
return (
<form
action={async () => {
"use server";
await signOut();
}}
>
<p>{children}</p>
<button type="submit">Sign out</button>
</form>
);
}
export default async function Page() {
let session = await auth();
let user = session?.user?.email;
return (
<section>
<h1>Home</h1>
<div>{user ? <SignOut>{`Welcome ${user}`}</SignOut> : <SignIn />}</div>
</section>
);
}

Xet Storage Details

Size:
814 Bytes
·
Xet hash:
dd4f3bcc5789899e44b386b471266621b9fb3b4357fb5856acfa606b424d72cb

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.