NextJS Fief Auth (Draft)

This commit is contained in:
Koper
2023-08-17 23:32:42 +07:00
parent 1b1e67901c
commit 067d1fbd4b
6 changed files with 144 additions and 9 deletions

23
www/app/userInfo.tsx Normal file
View File

@@ -0,0 +1,23 @@
"use client";
import { useFiefUserinfo } from "@fief/fief/nextjs/react";
export default function UserInfo() {
const userinfo = useFiefUserinfo();
return (
<>
{userinfo && (
<>
<h1>Logged In</h1>
<p>{userinfo.email}</p>
</>
)}
{!userinfo && (
<>
<h1>Not Logged In</h1>
</>
)}
</>
);
}