added verify_logic
This commit is contained in:
parent
83bd904299
commit
1af147e9e5
14
verify_logic.js
Normal file
14
verify_logic.js
Normal 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");
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user