mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-16 17:46:45 +00:00
feat(core): Add MFA (#4767)
https://linear.app/n8n/issue/ADO-947/sync-branch-with-master-and-fix-fe-e2e-tets --------- Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import 'cypress-real-events';
|
||||
import { WorkflowPage } from '../pages';
|
||||
import { BACKEND_BASE_URL, N8N_AUTH_COOKIE } from '../constants';
|
||||
import generateOTPToken from 'cypress-otp';
|
||||
|
||||
Cypress.Commands.add('getByTestId', (selector, ...args) => {
|
||||
return cy.get(`[data-test-id="${selector}"]`, ...args);
|
||||
@@ -41,14 +42,13 @@ Cypress.Commands.add('waitForLoad', (waitForIntercepts = true) => {
|
||||
|
||||
Cypress.Commands.add('signin', ({ email, password }) => {
|
||||
Cypress.session.clearAllSavedSessions();
|
||||
cy.session(
|
||||
[email, password],
|
||||
() => cy.request('POST', `${BACKEND_BASE_URL}/rest/login`, { email, password }),
|
||||
{
|
||||
validate() {
|
||||
cy.getCookie(N8N_AUTH_COOKIE).should('exist');
|
||||
},
|
||||
},
|
||||
cy.session([email, password], () =>
|
||||
cy.request({
|
||||
method: 'POST',
|
||||
url: `${BACKEND_BASE_URL}/rest/login`,
|
||||
body: { email, password },
|
||||
failOnStatusCode: false,
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
@@ -162,3 +162,7 @@ Cypress.Commands.add('draganddrop', (draggableSelector, droppableSelector) => {
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Cypress.Commands.add('generateToken', (secret: string) => {
|
||||
return generateOTPToken(secret);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user