fix: stabilize local admin auth workflow
Quality / test (push) Canceled after 0s

This commit is contained in:
2026-09-08 22:56:24 -04:00
parent 4f71d3d8de
commit ba221d57c5
3 changed files with 14 additions and 3 deletions
@@ -1,4 +1,7 @@
import 'dotenv/config';
import dotenv from 'dotenv';
import { fileURLToPath } from 'node:url';
dotenv.config({ path: fileURLToPath(new URL('../../../../../../.env', import.meta.url)) });
import { createDatabase } from '../../../infrastructure/database/client.js';
import { createUserRepository } from '../repositories/user-repository.js';
+3 -1
View File
@@ -9,7 +9,7 @@ import LoginPage from '@/pages/LoginPage.vue';
import { useAuth } from '@/composables/useAuth.js';
import AdminImagePage from '@/pages/AdminImagePage.vue';
export default createRouter({
const router = createRouter({
history: createWebHistory(),
routes: [
{ path: '/', name: 'catalog', component: CatalogPage },
@@ -27,6 +27,8 @@ export default createRouter({
],
});
export default router;
const auth = useAuth();
router.beforeEach(async (to) => {
if (!to.path.startsWith('/admin')) return true;
+7 -1
View File
@@ -4,9 +4,15 @@ export default defineConfig({
testDir: './apps/web/tests/e2e',
timeout: 30_000,
use: {
baseURL: process.env.E2E_BASE_URL ?? 'http://127.0.0.1:5173',
baseURL: process.env.E2E_BASE_URL ?? 'http://localhost:5173',
trace: 'on-first-retry',
screenshot: 'only-on-failure',
},
webServer: {
command: 'npm run dev:web',
url: 'http://localhost:5173',
reuseExistingServer: true,
timeout: 30_000,
},
reporter: [['list']],
});