Fix admin credentials and frontend error handling
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
- Changed admin email to admin@brandmaster.com (no dash) - Changed admin password to Admin123! - Fixed frontend Home.jsx to handle API errors gracefully - Added fallback to empty arrays when API calls fail - This prevents 'Cannot read properties of undefined' crash
This commit is contained in:
parent
0fd72aec62
commit
121f677f34
@ -10,8 +10,8 @@ class Settings(BaseSettings):
|
|||||||
frontend_url: str = "http://localhost:5173"
|
frontend_url: str = "http://localhost:5173"
|
||||||
|
|
||||||
# Admin user credentials (created on first startup)
|
# Admin user credentials (created on first startup)
|
||||||
admin_email: str = "admin@brand-master.com"
|
admin_email: str = "admin@brandmaster.com"
|
||||||
admin_password: str = "admin123" # Change via ADMIN_PASSWORD env var
|
admin_password: str = "Admin123!" # Change via ADMIN_PASSWORD env var
|
||||||
admin_full_name: str = "System Administrator"
|
admin_full_name: str = "System Administrator"
|
||||||
|
|
||||||
# Email configuration for password reset
|
# Email configuration for password reset
|
||||||
|
|||||||
@ -25,12 +25,17 @@ export default function Home() {
|
|||||||
api.get('/categories'),
|
api.get('/categories'),
|
||||||
])
|
])
|
||||||
|
|
||||||
setFeatured(featuredRes.data)
|
setFeatured(featuredRes?.data || [])
|
||||||
setNewArrivals(newRes.data)
|
setNewArrivals(newRes?.data || [])
|
||||||
setOnSale(saleRes.data)
|
setOnSale(saleRes?.data || [])
|
||||||
setCategories(catRes.data)
|
setCategories(catRes?.data || [])
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error fetching data:', error)
|
console.error('Error fetching data:', error)
|
||||||
|
// Set empty arrays on error to prevent crashes
|
||||||
|
setFeatured([])
|
||||||
|
setNewArrivals([])
|
||||||
|
setOnSale([])
|
||||||
|
setCategories([])
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false)
|
setLoading(false)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user