mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
feat(core): Prevent session hijacking (#9057)
This commit is contained in:
committed by
GitHub
parent
5793e5644a
commit
28261047c3
@@ -82,6 +82,7 @@ describe('OwnerController', () => {
|
||||
role: 'global:owner',
|
||||
authIdentities: [],
|
||||
});
|
||||
const browserId = 'test-browser-id';
|
||||
const req = mock<OwnerRequest.Post>({
|
||||
body: {
|
||||
email: 'valid@email.com',
|
||||
@@ -90,6 +91,7 @@ describe('OwnerController', () => {
|
||||
lastName: 'Doe',
|
||||
},
|
||||
user,
|
||||
browserId,
|
||||
});
|
||||
const res = mock<Response>();
|
||||
configGetSpy.mockReturnValue(false);
|
||||
@@ -103,7 +105,7 @@ describe('OwnerController', () => {
|
||||
where: { role: 'global:owner' },
|
||||
});
|
||||
expect(userRepository.save).toHaveBeenCalledWith(user, { transaction: false });
|
||||
expect(authService.issueCookie).toHaveBeenCalledWith(res, user);
|
||||
expect(authService.issueCookie).toHaveBeenCalledWith(res, user, browserId);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user