https://cypress.io logo
Whenever I try to intercept a cognito call and ret...
# e2e-testing
a
Whenever I try to intercept a cognito call and return my own stub (with or without use of a fixture) it ends up as a CORS error. Can't seem to find the documentation on this though. What am I doing wrong?
Copy code
ts
    cy.intercept('OPTIONS', 'https://cognito-idp.us-east-1.amazonaws.com', { statusCode: 200 })
    cy.intercept('POST', 'https://cognito-idp.us-east-1.amazonaws.com', {
      statusCode: 200,
      headers: {
        'access-control-allow-origin': window.location.origin,
        'Access-Control-Allow-Credentials': 'true',
      }, body: {
        // stuff
      }
    })
  })