import { createFileRoute } from '@tanstack/react-router'
import { useAuth } from '@workos-inc/authkit-react'
export const Route = createFileRoute('/demo/workos')({
ssr: false,
component: App,
})
function App() {
const { user, isLoading, signIn, signOut } = useAuth()
if (isLoading) {
return (
)
}
if (user) {
return (
User Profile
{/* Profile Picture */}
{user.profilePictureUrl && (
)}
{/* User Information */}
{user.firstName || 'N/A'}
{user.lastName || 'N/A'}
{user.email || 'N/A'}
{user.id || 'N/A'}
{/* Sign Out Button */}
)
}
return (
WorkOS Authentication
Sign in to view your profile information
)
}