import { useRouter } from "next/router"; import { useEffect, useState } from "react"; import { getAccessToken, usePrivy } from "@privy-io/react-auth"; import Head from "next/head"; async function verifyToken() { const url = "/api/verify"; const accessToken = await getAccessToken(); const result = await fetch(url, { headers: { ...(accessToken ? { Authorization: `Bearer ${accessToken}` } : undefined), }, }); return await result.json(); } export default function DashboardPage() { const [verifyResult, setVerifyResult] = useState(); const router = useRouter(); const { ready, authenticated, user, logout, linkEmail, linkWallet, unlinkEmail, linkPhone, unlinkPhone, unlinkWallet, linkGoogle, unlinkGoogle, linkTwitter, unlinkTwitter, linkDiscord, unlinkDiscord, } = usePrivy(); useEffect(() => { if (ready && !authenticated) { router.push("/"); } }, [ready, authenticated, router]); const numAccounts = user?.linkedAccounts?.length || 0; const canRemoveAccount = numAccounts > 1; const email = user?.email; const phone = user?.phone; const wallet = user?.wallet; const googleSubject = user?.google?.subject || null; const twitterSubject = user?.twitter?.subject || null; const discordSubject = user?.discord?.subject || null; return ( <> Account Settings
{ready && authenticated ? ( <>

Welcome Warlock,

$0.1

{twitterSubject ? ( ) : ( )} {discordSubject ? ( ) : ( )} {wallet ? ( ) : ( )}
) : null}
); }