Fix admin credentials and frontend error handling
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:
dvirlabs 2026-05-08 15:14:27 +03:00
parent 0fd72aec62
commit 121f677f34
2 changed files with 11 additions and 6 deletions

View File

@ -10,8 +10,8 @@ class Settings(BaseSettings):
frontend_url: str = "http://localhost:5173"
# Admin user credentials (created on first startup)
admin_email: str = "admin@brand-master.com"
admin_password: str = "admin123" # Change via ADMIN_PASSWORD env var
admin_email: str = "admin@brandmaster.com"
admin_password: str = "Admin123!" # Change via ADMIN_PASSWORD env var
admin_full_name: str = "System Administrator"
# Email configuration for password reset

View File

@ -25,12 +25,17 @@ export default function Home() {
api.get('/categories'),
])
setFeatured(featuredRes.data)
setNewArrivals(newRes.data)
setOnSale(saleRes.data)
setCategories(catRes.data)
setFeatured(featuredRes?.data || [])
setNewArrivals(newRes?.data || [])
setOnSale(saleRes?.data || [])
setCategories(catRes?.data || [])
} catch (error) {
console.error('Error fetching data:', error)
// Set empty arrays on error to prevent crashes
setFeatured([])
setNewArrivals([])
setOnSale([])
setCategories([])
} finally {
setLoading(false)
}