Bugs fixed: - Auth middleware now works on page refresh (plugin restores auth from localStorage before middleware runs) - Bezier drag no longer snaps back: removed client-side p0 recalculation during drag, only server computes p0 on mouseUp - Removed redundant /login.vue page (homepage already has links) New features: - Interactive zoom on Bezier chart (buttons + mouse wheel + tier 1/tier 2 presets) - Toggle to display outlier vote curves (public overlay endpoint) - Tier 1 curve visually emphasized (thicker stroke) - Dev credentials file at data/DEV-CREDENTIALS.md Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
12 lines
321 B
TypeScript
12 lines
321 B
TypeScript
/**
|
|
* Route middleware: redirects to login if user is not an admin.
|
|
* Apply via definePageMeta({ middleware: 'admin' }) on admin pages.
|
|
*/
|
|
export default defineNuxtRouteMiddleware((to) => {
|
|
const authStore = useAuthStore()
|
|
|
|
if (!authStore.isAuthenticated || !authStore.isAdmin) {
|
|
return navigateTo('/')
|
|
}
|
|
})
|