added verify_logic

This commit is contained in:
Mohammad Yaseen 2025-12-18 15:03:07 +05:30
parent 83bd904299
commit 1af147e9e5

14
verify_logic.js Normal file
View File

@ -0,0 +1,14 @@
const process = { env: { API_KEY_PREFIX: 'vf_live_' } }; // Now it should be vf_live_
const generatedKey = 'vf_live_' + '1234567890abcdef12345678';
const prefix = process.env.API_KEY_PREFIX || 'vf_live_';
const testPrefix = 'vf_test_';
console.log(`Env Prefix: ${prefix}`);
console.log(`Generated Key: ${generatedKey}`);
if (!generatedKey.startsWith(prefix) && !generatedKey.startsWith(testPrefix)) {
console.log("FAIL: Key would be rejected by middleware");
process.exit(1);
} else {
console.log("PASS: Key would be accepted");
}