From 4b05f67b2c79eefae4a3e13d8b8d33d9cc4b7e78 Mon Sep 17 00:00:00 2001 From: Karolina Rakoczy Date: Fri, 17 Dec 2021 14:27:13 +0100 Subject: [PATCH] fix login by API (#1700) --- cypress/support/customCommands/user/index.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cypress/support/customCommands/user/index.js b/cypress/support/customCommands/user/index.js index e437f8f5a..bfdb5f79d 100644 --- a/cypress/support/customCommands/user/index.js +++ b/cypress/support/customCommands/user/index.js @@ -21,6 +21,8 @@ Cypress.Commands.add( const mutation = `mutation TokenAuth{ tokenCreate(email: "${user.email}", password: "${user.password}") { token + csrfToken + refreshToken errors: accountErrors { code field @@ -32,6 +34,10 @@ Cypress.Commands.add( } }`; return cy.sendRequestWithQuery(mutation, authorization).then(resp => { + window.localStorage.setItem( + "_saleorCSRFToken", + resp.body.data.tokenCreate.csrfToken + ); window.sessionStorage.setItem( authorization, resp.body.data.tokenCreate.token