Gate admin menu and authoring with shared JWT
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import { defineConfig } from '@playwright/test'
|
||||
import jwt from 'jsonwebtoken'
|
||||
|
||||
const port = 18788
|
||||
const adminToken = jwt.sign({ sub: 'e2e-admin', role: 'admin' }, 'osint-e2e-jwt-secret')
|
||||
|
||||
export default defineConfig({
|
||||
testDir: './e2e',
|
||||
@@ -12,6 +14,7 @@ export default defineConfig({
|
||||
baseURL: `http://127.0.0.1:${port}`,
|
||||
headless: true,
|
||||
viewport: { width: 1280, height: 720 },
|
||||
extraHTTPHeaders: { Cookie: `auth_token=${adminToken}` },
|
||||
},
|
||||
webServer: {
|
||||
command: 'npm run e2e:serve',
|
||||
|
||||
Reference in New Issue
Block a user