I can't figure out how cy.origin should help me, can you give an example by inserting it into my code
```const dataJson = 'data/data.json';
var data;
const login = (email) => { //It's working fine
cy.session(email, () => {
cy.visit('https://mysite.com')
cy.get('#LoginForm_email').type(email);
cy.get('#LoginForm_password').type(data.password, { log: false });
cy.get('#login-btn').click();
})
}
describe('test', () => {
beforeEach(function () {
cy.fixture(dataJson).then((json) => { data = json; })
cy.viewport(1400, 900);
})
it.only('test1', () => {
login(data.mail);
cy.visit('https://mysite.com') //Login goes well and the site enters
cy.visit('https://login:password@https://sekondsite.com'); //On the other site, authorization is required and it also works fine
cy.visit('https://sekondsite.com', { //This authentication also works.
auth: {
username: 'login',
password: 'password',
},
});
cy.visit('https://login:password@mysite.com/item'); //When you go to this page, it loads, but some elements require
//authorization on the site "sekondsite.com" to load, and here authorization no longer works
cy.visit('https://mysite.com/item', { //This option doesn't work either.
auth: {
username: 'login',
password: 'password',
},
});
});
})```js