mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
feat(core): Invalidate all sessions when MFA is enabled/disabled (#15524)
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import { AuthIdentity } from '@n8n/db';
|
||||
import { type User } from '@n8n/db';
|
||||
import { AuthIdentityRepository } from '@n8n/db';
|
||||
import { AuthUserRepository } from '@n8n/db';
|
||||
import { UserRepository } from '@n8n/db';
|
||||
import { Container } from '@n8n/di';
|
||||
import type { ApiKeyScope, GlobalRole } from '@n8n/permissions';
|
||||
@@ -73,11 +72,14 @@ export async function createUserWithMfaEnabled(
|
||||
email,
|
||||
});
|
||||
|
||||
await Container.get(AuthUserRepository).update(user.id, {
|
||||
await Container.get(UserRepository).update(user.id, {
|
||||
mfaSecret: encryptedSecret,
|
||||
mfaRecoveryCodes: encryptedRecoveryCodes,
|
||||
});
|
||||
|
||||
user.mfaSecret = encryptedSecret;
|
||||
user.mfaRecoveryCodes = encryptedRecoveryCodes;
|
||||
|
||||
return {
|
||||
user,
|
||||
rawPassword: password,
|
||||
|
||||
Reference in New Issue
Block a user