I replaced the theme's api with our api.
I'm getting the connection, but I can't redirect to the menu after being authenticated.
I'm using the metronic demo6 - REACT theme.
Can someone help me?
Hi Lohuama Lima,
To redirect user to main page you can just set current authentication with saveAuth function.
You can refer to our example in file src/app/modules/auth/components/Login.tsx.
const {saveAuth, setCurrentUser} = useAuth()
saveAuth(auth)
setCurrentUser(user)
const {currentUser} = useAuth()
{currentUser ? (
<>
<Route path="/*" element={<PrivateRoutes />} />
<Route index element={<Navigate to="/dashboard" />} />
</>
) : (
<>
<Route path="auth/*" element={<AuthPage />} />
<Route path="*" element={<Navigate to="/auth" />} />
</>
)}