Fix: Wrap components with AuthProvider
The `useAuth` hook was being called outside of the `AuthProvider`, leading to an error. This commit ensures that all components using `useAuth` are wrapped within the `AuthProvider`.
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
import React, { useEffect } from 'react';
|
||||
import { Routes, Route } from 'react-router-dom';
|
||||
import { BudgetProvider } from './contexts/budget/BudgetContext';
|
||||
import { AuthProvider } from './contexts/auth/AuthProvider';
|
||||
import { Toaster } from './components/ui/toaster';
|
||||
import Index from './pages/Index';
|
||||
import Login from './pages/Login';
|
||||
@@ -23,6 +24,7 @@ function App() {
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<AuthProvider>
|
||||
<BudgetProvider>
|
||||
<div className="App">
|
||||
<Routes>
|
||||
@@ -43,6 +45,7 @@ function App() {
|
||||
<Toaster />
|
||||
</div>
|
||||
</BudgetProvider>
|
||||
</AuthProvider>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user