feat(core): Allow enforcement of MFA usage on instance (#16556)

Co-authored-by: Marc Littlemore <marc@n8n.io>
Co-authored-by: Csaba Tuncsik <csaba.tuncsik@gmail.com>
This commit is contained in:
Andreas Fitzek
2025-07-02 11:03:10 +02:00
committed by GitHub
parent 060acd2db8
commit 657e5a3b3a
56 changed files with 619 additions and 88 deletions

View File

@@ -58,7 +58,11 @@ function createAgent(
if (withRestSegment) void agent.use(prefix(REST_PATH_SEGMENT));
if (options?.auth && options?.user) {
const token = Container.get(AuthService).issueJWT(options.user, browserId);
const token = Container.get(AuthService).issueJWT(
options.user,
options.user.mfaEnabled,
browserId,
);
agent.jar.setCookie(`${AUTH_COOKIE_NAME}=${token}`);
}
return agent;