useAuth():MonoCloudAuth
useAuth() is a client-side hook that exposes the current authentication
state and actions provided by MonoCloudAuthProvider.
"use client";
import { useAuth } from "@monocloud/auth-react";
export default function Home() {
const { isLoading, isAuthenticated, user } = useAuth();
if (isLoading) {
return <>Loading...</>;
}
if (!isAuthenticated) {
return <>Not signed in</>;
}
return <>User Id: {user?.sub}</>;
}