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