fix(ci): use process.env directly for BYPASS_CSRF setting

vi.stubEnv doesn't work reliably with dynamically imported modules.
Using direct process.env assignment instead.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Martin Porwoll 2025-12-15 13:42:19 +00:00
parent 97ede2ceb9
commit eb48088887

View file

@ -9,7 +9,8 @@ import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest'
import { NextRequest, NextResponse } from 'next/server'
// Enable CSRF validation in CI by setting BYPASS_CSRF=false
vi.stubEnv('BYPASS_CSRF', 'false')
// This must be set before any module imports that read this variable
process.env.BYPASS_CSRF = 'false'
import {
generateTestCsrfToken,
generateExpiredCsrfToken,