mirror of
https://github.com/9technologygroup/patchmon.net.git
synced 2025-11-04 14:03:17 +00:00
Fix React error #301
This commit is contained in:
@@ -17,10 +17,6 @@ export const AuthProvider = ({ children }) => {
|
|||||||
const [isLoading, setIsLoading] = useState(true)
|
const [isLoading, setIsLoading] = useState(true)
|
||||||
const [permissionsLoading, setPermissionsLoading] = useState(false)
|
const [permissionsLoading, setPermissionsLoading] = useState(false)
|
||||||
const [needsFirstTimeSetup, setNeedsFirstTimeSetup] = useState(false)
|
const [needsFirstTimeSetup, setNeedsFirstTimeSetup] = useState(false)
|
||||||
|
|
||||||
// TEMPORARY DEBUG: Force admin setup for testing
|
|
||||||
// Remove this line after debugging
|
|
||||||
setNeedsFirstTimeSetup(true)
|
|
||||||
const [checkingSetup, setCheckingSetup] = useState(true)
|
const [checkingSetup, setCheckingSetup] = useState(true)
|
||||||
|
|
||||||
// Initialize auth state from localStorage
|
// Initialize auth state from localStorage
|
||||||
@@ -236,7 +232,9 @@ export const AuthProvider = ({ children }) => {
|
|||||||
if (response.ok) {
|
if (response.ok) {
|
||||||
const data = await response.json()
|
const data = await response.json()
|
||||||
console.log('Admin check response:', data) // Debug log
|
console.log('Admin check response:', data) // Debug log
|
||||||
setNeedsFirstTimeSetup(!data.hasAdminUsers)
|
// TEMPORARY DEBUG: Force admin setup for testing
|
||||||
|
// setNeedsFirstTimeSetup(!data.hasAdminUsers)
|
||||||
|
setNeedsFirstTimeSetup(true) // Force setup for testing
|
||||||
} else {
|
} else {
|
||||||
console.log('Admin check failed:', response.status, response.statusText) // Debug log
|
console.log('Admin check failed:', response.status, response.statusText) // Debug log
|
||||||
// If endpoint doesn't exist or fails, assume setup is needed
|
// If endpoint doesn't exist or fails, assume setup is needed
|
||||||
|
|||||||
Reference in New Issue
Block a user