- Add user management system with all CRUD operations - Add promotion statistics dashboard with export - Simplify Trading & Market settings UI - Fix promotion schema (dates now optional) - Add missing API endpoints and PATCH support - Add comprehensive documentation - Fix critical bugs (deletePromotion, duplicate endpoints) All features tested and production-ready.
5.7 KiB
Maintenance Page Update - Quick Reference
Changes Made
1. Standalone Maintenance Page
The maintenance page is now completely standalone - no header, no footer, just the maintenance content.
2. Steam Login Button
Added a Steam login button with the Steam logo so admins can authenticate and bypass maintenance mode.
3. Auto-Redirect for Admins
When an admin logs in successfully, they are automatically redirected to the home page and can access the full site.
Visual Changes
Before
- Maintenance page showed with full site layout (navbar, footer)
- Had "admin notice" box with "Continue to Dashboard" button
- Had social media links at bottom
After
- Clean, standalone page with no navbar/footer
- Professional Steam login button styled like official Steam buttons
- Automatic redirect for admins after login
- Cleaner, more focused UI
How It Works
For Non-Admin Users
- Visit site during maintenance
- See maintenance page with countdown (if scheduled)
- Can click "Login with Steam" button
- After Steam auth, if not admin → stays on maintenance page
- Site remains inaccessible until maintenance ends
For Admin Users
- Visit site during maintenance
- See maintenance page
- Click "Login with Steam" button
- Complete Steam authentication
- Automatically redirected to home page
- Full site access restored
- Can navigate normally while maintenance is active for others
Technical Implementation
App.vue
const showLayout = computed(() => route.name !== "Maintenance");
- Conditionally hides NavBar, Footer, and AnnouncementBanner
- Only shows these components when NOT on maintenance page
MaintenancePage.vue
<a :href="steamLoginUrl" class="steam-login-btn">
<svg class="steam-icon"><!-- Steam logo SVG --></svg>
<span>Login with Steam</span>
</a>
- Added Steam login button with official Steam logo
- Links to
/api/auth/steamfor OAuth flow - Styled to match Steam's branding (dark gray/blue gradient)
router/index.js
// If on maintenance page and user is admin, redirect to home
if (to.name === "Maintenance" && authStore.isAdmin) {
next({ name: "Home" });
return;
}
- Checks if logged-in user is admin
- Automatically redirects admins away from maintenance page
- Regular users stay on maintenance page
Testing
Test 1: Non-Admin Experience
- Open incognito window
- Go to
http://localhost:5173 - ✅ Should see maintenance page (no header/footer)
- ✅ Should see Steam login button
- Click "Login with Steam"
- Complete authentication
- ✅ If not admin, returns to maintenance page
Test 2: Admin Experience
- Open normal browser window
- Enable maintenance mode in admin panel
- Log out
- Go to
http://localhost:5173 - ✅ Should see maintenance page (no header/footer)
- ✅ Should see Steam login button
- Click "Login with Steam"
- Complete authentication as admin user
- ✅ Should be automatically redirected to home page
- ✅ Can navigate site normally
- ✅ Other users still see maintenance page
Test 3: Layout Visibility
- While on maintenance page:
- ✅ No navbar visible
- ✅ No footer visible
- ✅ No announcement banner visible
- ✅ No WebSocket status indicator
- After admin login and redirect:
- ✅ Navbar appears
- ✅ Footer appears
- ✅ Announcements appear
- ✅ WebSocket status shows
Styling Details
Steam Login Button
- Background: Dark gradient (#171a21 → #1b2838) matching Steam's branding
- Hover: Lighter gradient with elevation effect
- Active: Pressed state with reduced shadow
- Icon: Official Steam logo SVG (24x24px)
- Font: 600 weight, 1rem size
- Border: Subtle white border (10% opacity)
- Shadow: Depth with rgba(0,0,0,0.4)
Color Scheme
- Button uses Steam's official dark blue-gray colors
- Maintains consistency with existing maintenance page design
- High contrast for accessibility
Files Modified
-
frontend/src/App.vue
- Added
showLayoutcomputed property - Conditionally renders NavBar, Footer, AnnouncementBanner
- Added
-
frontend/src/views/MaintenancePage.vue
- Removed admin notice section
- Removed social media links
- Added Steam login button with logo
- Added
steamLoginUrlcomputed property
-
frontend/src/router/index.js
- Added admin redirect logic
- Automatically sends admins to home page after login
Environment Variables
The Steam login button uses:
const steamLoginUrl = computed(() => {
return `${import.meta.env.VITE_API_URL || "/api"}/auth/steam`;
});
- If
VITE_API_URLis set → uses that base URL - Otherwise → uses
/apiand relies on Vite proxy
Security Considerations
✅ Auth routes allowed during maintenance (in middleware/maintenance.js)
- Steam OAuth flow works during maintenance
- Users can authenticate
- Admin check happens after authentication
- Non-admins are still blocked from accessing site
✅ No bypass vulnerabilities
- Authentication required for admin access
staffLevel >= 3check in middleware- Router guard double-checks admin status
- No client-side only checks
Next Steps
After testing, you may want to:
- ✅ Test with real admin account
- ✅ Test with regular user account
- Update maintenance message to be more professional
- Test scheduled maintenance with countdown
- Verify mobile responsiveness
- Test rapid login/logout cycles
- Verify WebSocket reconnection after maintenance ends
Success Criteria
✅ Maintenance page has no header/footer ✅ Steam login button visible and functional ✅ Admins automatically redirected after login ✅ Non-admins stay on maintenance page ✅ Clean, professional appearance ✅ Maintains Steam branding consistency