mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
fix(core): Prevent issues with missing or mismatching encryption key (#8332)
This commit is contained in:
@@ -24,6 +24,12 @@ describe('InstanceSettings', () => {
|
||||
readSpy.mockReturnValue('{"encryptionKey":"test_key"');
|
||||
expect(() => new InstanceSettings()).toThrowError();
|
||||
});
|
||||
|
||||
it('should throw if the env and file keys do not match', () => {
|
||||
readSpy.mockReturnValue(JSON.stringify({ encryptionKey: 'key_1' }));
|
||||
process.env.N8N_ENCRYPTION_KEY = 'key_2';
|
||||
expect(() => new InstanceSettings()).toThrowError();
|
||||
});
|
||||
});
|
||||
|
||||
describe('If the settings file does not exist', () => {
|
||||
|
||||
Reference in New Issue
Block a user