UNPKG

starkon

Version:

Complete Next.js boilerplate with authentication, i18n & CLI - Create production-ready apps instantly

15 lines (10 loc) 327 B
'use client' import { useContext } from 'react' import { AuthContext, type AuthContextType } from '@/providers/AuthProvider' export const useAuth = (): AuthContextType => { const context = useContext(AuthContext) if (!context) { throw new Error('useAuth must be used within an AuthProvider') } return context }