fix: syntax error in AuthContext

This commit is contained in:
Hymmel 2026-01-21 11:57:02 +01:00
parent b96fb0d0e4
commit 31348cb6d1

View file

@ -177,6 +177,9 @@ export function AuthProvider({ children }: { children: ReactNode }) {
} }
} catch (e) { } catch (e) {
console.error(e) console.error(e)
}
}, [authHeader, fetchTickets])
const deleteTicket = useCallback(async (ticketId: number) => { const deleteTicket = useCallback(async (ticketId: number) => {
if (!authHeader) return if (!authHeader) return
try { try {
@ -211,12 +214,12 @@ export function AuthProvider({ children }: { children: ReactNode }) {
{children} {children}
</AuthContext.Provider> </AuthContext.Provider>
) )
} }
export function useAuth() { export function useAuth() {
const context = useContext(AuthContext) const context = useContext(AuthContext)
if (!context) { if (!context) {
throw new Error("useAuth must be used within an AuthProvider") throw new Error("useAuth must be used within an AuthProvider")
} }
return context return context
} }