From 2de639bac2901006e6d0030e77c6a5f650b6e9d9 Mon Sep 17 00:00:00 2001 From: Karolina Rakoczy Date: Fri, 17 Dec 2021 14:21:14 +0100 Subject: [PATCH] fix login by API (#1699) --- 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 e437f8f5abb..bfdb5f79dff 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