fix: harden production login and security headers
CI - Build & Test / Backend (.NET) (push) Successful in 41s
CI - Build & Test / Frontend (Vue/TS) (push) Successful in 2m54s
CI - Build & Test / Security Check (push) Successful in 4s
CI - Build & Test / Deploy Nexus (push) Successful in 46s

This commit is contained in:
AzuTear
2026-07-31 22:56:55 +02:00
parent f5552218bc
commit 6f21d9ba97
4 changed files with 55 additions and 12 deletions
+29
View File
@@ -44,6 +44,35 @@ test.describe('authenticated route and deep-link smoke', () => {
await expect(page.getByRole('button', { name: 'Anmelden' })).toBeVisible()
})
test('does not present the rolling login window as a lock while attempts remain', async ({ page }) => {
await mockNexusApi(page, { authenticated: false })
await page.route('**/api/v1/auth/login', async route => {
await route.fulfill({
status: 401,
contentType: 'application/problem+json',
headers: {
'X-RateLimit-Remaining': '4',
'X-RateLimit-Reset': String(Math.ceil(Date.now() / 1000) + 60),
},
body: JSON.stringify({
message: 'Invalid email or password.',
remaining: 4,
retryAfterSeconds: 60,
}),
})
})
await page.goto('/login')
await page.getByLabel('E-Mail').fill('release-smoke@example.invalid')
await page.getByLabel('Passwort', { exact: true }).fill('not-a-real-password')
await page.getByRole('button', { name: 'Anmelden' }).click()
await expect(page.getByRole('alert')).toContainText('4 Versuche verbleibend')
await expect(page.getByText(/Entsperrt in/)).toHaveCount(0)
await expect(page.getByRole('button', { name: 'Anmelden' })).toBeEnabled()
await expect(page.getByRole('button', { name: /Gesperrt/ })).toHaveCount(0)
})
test('renders the core owner deep links without a client-side exception', async ({ page }) => {
test.setTimeout(90_000)
await mockNexusApi(page, { role: 'owner' })