mirror of
https://github.com/ajurna/cbwebreader.git
synced 2026-11-02 18:46:53 +00:00
Upgrade frontend dependencies and switch ESLint to a flat config
- Runtime majors: vue-router 5, reveal.js 6, fontawesome 7. Checked against the code that uses them: no change needed for reveal.js (the default export is still a callable factory and every method/option used is still present) or fontawesome (all seven registered icons still resolve). - frontend/src/router/index.js: guards return the redirect instead of calling the deprecated next() callback, which works on vue-router 4 and 5. - Add frontend/eslint.config.mjs because eslint 10 requires a flat config; the lint script now runs eslint directly instead of vue-cli-service. - Drop tooling nothing in the webpack configs uses (@vue/cli-*, jshint, html-webpack-plugin, webpack-bundle-analyzer, @babel/core) and delete the dead vue.config.js. npm audit 35 -> 5 (all dev-only), --omit=dev is 0. - frontend/src/views/UserView.vue: the $route watcher no longer declares unused params.
This commit is contained in:
1 parent
6bcdf89fdc
commit
4d0ba750ad
6 files changed
+2777
-8461
No files matched your search
@@ -10,26 +10,22 @@ const LoginView = () => import('@/views/LoginView')
|
||||
const HistoryView = () => import('@/views/HistoryView')
|
||||
|
||||
// Navigation guard to check if user is authenticated
|
||||
function requireAuth(to, from, next) {
|
||||
function requireAuth(to) {
|
||||
if (!store.getters.isAuthenticated) {
|
||||
next({
|
||||
return {
|
||||
name: 'login',
|
||||
query: { next: to.fullPath, error: 'Please log in to access this page' }
|
||||
});
|
||||
} else {
|
||||
next();
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
// Navigation guard to check if user is admin
|
||||
function requireAdmin(to, from, next) {
|
||||
function requireAdmin(to) {
|
||||
if (!store.getters.isAuthenticated || !store.getters.is_superuser) {
|
||||
next({
|
||||
return {
|
||||
name: 'login',
|
||||
query: { next: to.fullPath, error: 'Admin access required' }
|
||||
});
|
||||
} else {
|
||||
next();
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ export default {
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
$route(to, from) {
|
||||
$route() {
|
||||
this.updateUsers()
|
||||
this.crumbs = [...default_crumbs]
|
||||
if (this.userid){
|
||||
|
||||
Reference in new issue
Block a user