fix login by API (#1700)
This commit is contained in:
parent
4880093f63
commit
4b05f67b2c
1 changed files with 6 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue