Function: useAuth
react-autonomyreact-autonomy.useAuth
▸ useAuth<T>(): UseAuthUseAuth<T>
The useAuth hook returns information about the current authentication session, and functions for logging in and logging out. Chord's preferred authentication provider is Magic through our chord-magic package.
import { useAuth } from '@chordcommerce/react-autonomy'
const AccountPage = () => {
const { isLoggedIn } = useAuth()
if (!isLoggedIn) return
// return account page
}Type parameters
Name | Type |
|---|---|
T | extends AuthClientAuthClient<any, T> = any |
Returns
UseAuthUseAuth<T>