n8n/packages/cli/src
Ricardo Espinoza f5502cc628
fix(core): Make sure mfa secret and recovery codes are not returned on login (#7936)
## Summary

What: Fix issue of login endpoint returning secret and recovery codes
when MFA is enabled. Bug was introduced in this
[PR](https://github.com/n8n-io/n8n/pull/6994), specifically in this
[line](https://github.com/n8n-io/n8n/pull/6994/files#diff-95a87cb029a3d26e6722df2e68132453fc254fc1f4540cbdaa95cfdbda1893deL91).

Why: We should not be filtering the secret and recovery codes

Same PR caused the issues on ticket ->
https://linear.app/n8n/issue/ADO-1494/on-user-list-copy-password-reset-link-and-copy-invite-link-are-broken

## Review / Merge checklist
- [x] PR title and summary are descriptive. **Remember, the title
automatically goes into the changelog. Use `(no-changelog)` otherwise.**
([conventions](https://github.com/n8n-io/n8n/blob/master/.github/pull_request_title_conventions.md))
- [x] [Docs updated](https://github.com/n8n-io/n8n-docs) or follow-up
ticket created.
- [x] Tests included.
> A bug is not considered fixed, unless a test is added to prevent it
from happening again. A feature is not complete without tests.
  >
> *(internal)* You can use Slack commands to trigger [e2e
tests](https://www.notion.so/n8n/How-to-use-Test-Instances-d65f49dfc51f441ea44367fb6f67eb0a?pvs=4#a39f9e5ba64a48b58a71d81c837e8227)
or [deploy test
instance](https://www.notion.so/n8n/How-to-use-Test-Instances-d65f49dfc51f441ea44367fb6f67eb0a?pvs=4#f6a177d32bde4b57ae2da0b8e454bfce)
or [deploy early access version on
Cloud](https://www.notion.so/n8n/Cloudbot-3dbe779836004972b7057bc989526998?pvs=4#fef2d36ab02247e1a0f65a74f6fb534e).
2023-12-06 10:00:13 +01:00
..
auth refactor(core): Switch plain errors in cli to ApplicationError (#7857) 2023-11-29 12:25:10 +01:00
collaboration feat(editor): Show avatars for users currently working on the same workflow (#7763) 2023-11-23 10:14:34 +01:00
commands refactor(core): Add log about removed TTL keys for binary data (#7892) 2023-12-01 12:51:45 +01:00
config refactor(core): Switch plain errors in cli to ApplicationError (#7857) 2023-11-29 12:25:10 +01:00
controllers fix: Return scopes on invitation accept endpoint (no-changelog) (#7917) 2023-12-05 11:18:41 +01:00
credentials fix(core): Consolidate ownership and sharing data on workflows and credentials (#7920) 2023-12-05 10:11:18 +01:00
databases feat: Replace owner checks with scope checks (no-changelog) (#7846) 2023-11-29 14:48:36 +00:00
decorators refactor(core): Switch plain errors in cli to ApplicationError (#7857) 2023-11-29 12:25:10 +01:00
environments refactor(core): Switch plain errors in cli to ApplicationError (#7857) 2023-11-29 12:25:10 +01:00
errors refactor(core): Reorganize error hierarchy in cli package (no-changelog) (#7839) 2023-11-28 10:19:27 +01:00
eventbus feat: Add initial scope checks via decorators (#7737) 2023-11-28 11:41:34 +00:00
executionLifecycleHooks refactor(core): Move execution progress saving to standalone utility (no-changelog) (#7770) 2023-11-27 13:10:43 +01:00
executions feat: Replace owner checks with scope checks (no-changelog) (#7846) 2023-11-29 14:48:36 +00:00
ExternalSecrets refactor(core): Switch plain errors in cli to ApplicationError (#7857) 2023-11-29 12:25:10 +01:00
helpers fix(core): Add check that queue is defined and remove cyclic dependency (#7404) 2023-10-13 11:53:59 +02:00
Ldap refactor(core): Switch plain errors in cli to ApplicationError (#7857) 2023-11-29 12:25:10 +01:00
license refactor(core): Reorganize error hierarchy in cli package (no-changelog) (#7839) 2023-11-28 10:19:27 +01:00
Mfa ci(core): Reduce memory usage in tests (part-2) (no-changelog) (#7671) 2023-11-10 15:04:26 +01:00
middlewares refactor(core): Switch plain errors in cli to ApplicationError (#7857) 2023-11-29 12:25:10 +01:00
permissions feat: Replace owner checks with scope checks (no-changelog) (#7846) 2023-11-29 14:48:36 +00:00
posthog refactor: Run lintfix (no-changelog) (#7537) 2023-10-27 14:15:02 +02:00
PublicApi feat: Add admin role to public API (no-changelog) (#7933) 2023-12-05 15:00:14 +00:00
push feat(core): Update LLM applications building support (no-changelog) (#7710) 2023-11-28 16:47:28 +01:00
security-audit perf(core): Lazyload security audit reporters (#7696) 2023-11-13 11:50:43 +01:00
services fix(core): Make sure mfa secret and recovery codes are not returned on login (#7936) 2023-12-06 10:00:13 +01:00
sso refactor(core): Switch plain errors in cli to ApplicationError (#7857) 2023-11-29 12:25:10 +01:00
telemetry refactor: Run lintfix (no-changelog) (#7537) 2023-10-27 14:15:02 +02:00
types refactor: Move CLI commands types to own dir (no-changelog) (#6658) 2023-07-13 10:10:08 +02:00
UserManagement feat: Replace owner checks with scope checks (no-changelog) (#7846) 2023-11-29 14:48:36 +00:00
workflows fix(core): Consolidate ownership and sharing data on workflows and credentials (#7920) 2023-12-05 10:11:18 +01:00
AbstractServer.ts refactor(core): Reorganize error hierarchy in cli package (no-changelog) (#7839) 2023-11-28 10:19:27 +01:00
ActivationErrors.service.ts feat(core): Coordinate manual workflow activation and deactivation in multi-main scenario (#7643) 2023-11-17 15:58:50 +01:00
ActiveExecutions.ts refactor(core): Switch plain errors in cli to ApplicationError (#7857) 2023-11-29 12:25:10 +01:00
ActiveWebhooks.ts refactor(core): Switch plain errors in cli to ApplicationError (#7857) 2023-11-29 12:25:10 +01:00
ActiveWorkflowRunner.ts feat: Replace owner checks with scope checks (no-changelog) (#7846) 2023-11-29 14:48:36 +00:00
constants.ts feat: Add AI tool building capabilities (#7336) 2023-11-29 12:13:55 +01:00
CrashJournal.ts refactor(core): Make Logger a service (no-changelog) (#7494) 2023-10-25 16:35:22 +02:00
CredentialsHelper.ts feat: Replace owner checks with scope checks (no-changelog) (#7846) 2023-11-29 14:48:36 +00:00
CredentialsOverwrites.ts refactor(core): Make Logger a service (no-changelog) (#7494) 2023-10-25 16:35:22 +02:00
CredentialTypes.ts refactor(core): Switch plain errors in cli to ApplicationError (#7857) 2023-11-29 12:25:10 +01:00
curlconverter.d.ts refactor: Clear unused ESLint directives from BE packages (no-changelog) (#6798) 2023-07-31 11:00:48 +02:00
CurlConverterHelper.ts refactor: Clear unused ESLint directives from BE packages (no-changelog) (#6798) 2023-07-31 11:00:48 +02:00
Db.ts refactor(core): Switch plain errors in cli to ApplicationError (#7857) 2023-11-29 12:25:10 +01:00
ErrorReporting.ts refactor(core): Reorganize error hierarchy in core and workflow packages (no-changelog) (#7820) 2023-11-27 15:33:21 +01:00
ExpressionEvalator.ts feat(core): Add Tournament as the new default expression evaluator (#6964) 2023-09-21 13:57:45 +01:00
ExternalHooks.ts refactor(core): Switch plain errors in cli to ApplicationError (#7857) 2023-11-29 12:25:10 +01:00
GenericHelpers.ts refactor(core): Reorganize error hierarchy in cli package (no-changelog) (#7839) 2023-11-28 10:19:27 +01:00
index.ts ci: Refactor cli tests to speed up CI (no-changelog) (#5718) 2023-03-17 17:24:05 +01:00
Interfaces.ts feat(core): Add Support for custom CORS origins for webhooks (#7455) 2023-11-22 17:49:56 +01:00
InternalHooks.ts fix(core): Prevent executions from becoming forever running (#7569) 2023-11-01 13:51:13 +01:00
jest.d.ts feat(core): Security audit (#5034) 2023-01-05 13:28:40 +01:00
License.ts feat(core): Set up endpoint for all existing roles with license flag (#7834) 2023-11-28 14:16:47 +01:00
LoadNodesAndCredentials.ts refactor(core): Switch plain errors in cli to ApplicationError (#7857) 2023-11-29 12:25:10 +01:00
Logger.ts ci: Stop disabling linting rules that are explicitly set to warn (no-changelog) (#7669) 2023-11-09 14:05:39 +01:00
NodeTypes.ts refactor(core): Switch plain errors in cli to ApplicationError (#7857) 2023-11-29 12:25:10 +01:00
Queue.ts refactor(core): Switch plain errors in cli to ApplicationError (#7857) 2023-11-29 12:25:10 +01:00
requests.ts fix(core): Consolidate ownership and sharing data on workflows and credentials (#7920) 2023-12-05 10:11:18 +01:00
ResponseHelper.ts refactor(core): Reorganize error hierarchy in cli package (no-changelog) (#7839) 2023-11-28 10:19:27 +01:00
SecretsHelpers.ts feat: External Secrets storage for credentials (#6477) 2023-08-25 10:33:46 +02:00
Server.ts feat: Replace owner checks with scope checks (no-changelog) (#7846) 2023-11-29 14:48:36 +00:00
sse-channel.d.ts feat(core): Add support for WebSockets as an alternative to Server-Sent Events (#5443) 2023-02-10 15:02:47 +01:00
TestWebhooks.ts refactor(core): Switch plain errors in cli to ApplicationError (#7857) 2023-11-29 12:25:10 +01:00
utils.ts fix(core): Set up OAuth2 cred test (#6960) 2023-08-18 16:18:44 +02:00
WaitingWebhooks.ts refactor(core): Reorganize error hierarchy in cli package (no-changelog) (#7839) 2023-11-28 10:19:27 +01:00
WaitTracker.ts refactor(core): Switch plain errors in cli to ApplicationError (#7857) 2023-11-29 12:25:10 +01:00
WebhookHelpers.ts refactor(core): Reorganize error hierarchy in cli package (no-changelog) (#7839) 2023-11-28 10:19:27 +01:00
WebhookServer.ts feat(core): Add unique id to instances (#6863) 2023-08-07 17:03:21 +02:00
WorkflowCredentials.ts refactor(core): Switch plain errors in cli to ApplicationError (#7857) 2023-11-29 12:25:10 +01:00
WorkflowExecuteAdditionalData.ts fix(core): Allow grace period for binary data deletion after manual execution (#7889) 2023-12-01 10:13:53 +01:00
WorkflowHelpers.ts feat: Replace owner checks with scope checks (no-changelog) (#7846) 2023-11-29 14:48:36 +00:00
WorkflowRunner.ts fix(core): Ensure failed executions are saved in queue mode (#7744) 2023-11-20 16:03:02 +01:00
WorkflowRunnerProcess.ts ci: Stop disabling linting rules that are explicitly set to warn (no-changelog) (#7669) 2023-11-09 14:05:39 +01:00