refactor: Add deprecation notice for basic auth and JWT auth (#6349)

This commit is contained in:
Iván Ovejero
2023-06-01 11:22:29 +02:00
committed by GitHub
parent f7708c9159
commit de77762e51
3 changed files with 28 additions and 13 deletions

View File

@@ -9,7 +9,7 @@ import { getLogger } from '@/Logger';
import config from '@/config';
import * as Db from '@/Db';
import * as CrashJournal from '@/CrashJournal';
import { inTest } from '@/constants';
import { USER_MANAGEMENT_DOCS_URL, inTest } from '@/constants';
import { CredentialTypes } from '@/CredentialTypes';
import { CredentialsOverwrites } from '@/CredentialsOverwrites';
import { initErrorHandling } from '@/ErrorReporting';
@@ -83,6 +83,18 @@ export abstract class BaseCommand extends Command {
);
}
if (process.env.N8N_BASIC_AUTH_ACTIVE === 'true') {
LoggerProxy.warn(
`Basic auth has been deprecated and will be removed in a future version of n8n. For authentication, please consider User Management. To learn more: ${USER_MANAGEMENT_DOCS_URL}`,
);
}
if (process.env.N8N_JWT_AUTH_ACTIVE === 'true') {
LoggerProxy.warn(
`JWT auth has been deprecated and will be removed in a future version of n8n. For authentication, please consider User Management. To learn more: ${USER_MANAGEMENT_DOCS_URL}`,
);
}
this.instanceId = this.userSettings.instanceId ?? '';
await Container.get(PostHogClient).init(this.instanceId);
await Container.get(InternalHooks).init(this.instanceId);