Cypress - Authentication and Sessions
Identify the error in this Cypress test snippet for token-based login:
cy.request('POST', '/api/login', { username: 'user', password: 'pass' })
.then((response) => {
cy.setCookie('authToken', response.token);
});