Skip to content

Commit bf57f4b

Browse files
committed
test(integration): align admin integration JWT secret with canonical resolver
The canonical getJwtSecret (routes/auth) prefers API_JWT_SECRET, which the loaded .env sets, so the admin integration suite must override API_JWT_SECRET (not only JWT_SECRET) to match the secret generateTestToken signs with.
1 parent 3c972bc commit bf57f4b

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

test/integration/routes/admin.integration.spec.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@ import { getUserStorageUsage } from '../../../src/db/queries/assets';
3737

3838
const TEST_JWT_SECRET = 'test_secret_for_integration_tests';
3939

40-
// Set JWT secret environment variable so admin routes use the same secret
40+
// Set JWT secret environment variables so admin routes verify with the same
41+
// secret these tests sign with. The canonical resolver (routes/auth.getJwtSecret)
42+
// prefers API_JWT_SECRET, which the loaded .env sets to a different value, so we
43+
// must override API_JWT_SECRET — not only JWT_SECRET — here.
44+
process.env.API_JWT_SECRET = TEST_JWT_SECRET;
4145
process.env.JWT_SECRET = TEST_JWT_SECRET;
4246

4347
// ============================================================================

0 commit comments

Comments
 (0)