mirror of
https://github.com/9technologygroup/patchmon.net.git
synced 2025-11-10 08:55:44 +00:00
Fixed isAuthenticated function
This commit is contained in:
@@ -22,9 +22,10 @@ import FirstTimeAdminSetup from './components/FirstTimeAdminSetup'
|
|||||||
|
|
||||||
function AppRoutes() {
|
function AppRoutes() {
|
||||||
const { needsFirstTimeSetup, checkingSetup, isAuthenticated } = useAuth()
|
const { needsFirstTimeSetup, checkingSetup, isAuthenticated } = useAuth()
|
||||||
|
const isAuth = isAuthenticated() // Call the function to get boolean value
|
||||||
|
|
||||||
// Debug logging
|
// Debug logging
|
||||||
console.log('AppRoutes state:', { needsFirstTimeSetup, checkingSetup, isAuthenticated })
|
console.log('AppRoutes state:', { needsFirstTimeSetup, checkingSetup, isAuthenticated: isAuth })
|
||||||
|
|
||||||
// Show loading while checking if setup is needed
|
// Show loading while checking if setup is needed
|
||||||
if (checkingSetup) {
|
if (checkingSetup) {
|
||||||
@@ -40,7 +41,7 @@ function AppRoutes() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Show first-time setup if no admin users exist
|
// Show first-time setup if no admin users exist
|
||||||
if (needsFirstTimeSetup && !isAuthenticated) {
|
if (needsFirstTimeSetup && !isAuth) {
|
||||||
console.log('Showing FirstTimeAdminSetup component...')
|
console.log('Showing FirstTimeAdminSetup component...')
|
||||||
return <FirstTimeAdminSetup />
|
return <FirstTimeAdminSetup />
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user