Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Storefront: The provided CSRF token is not valid #45

Closed
ChristopherDosin opened this issue Sep 12, 2020 · 2 comments
Closed

Storefront: The provided CSRF token is not valid #45

ChristopherDosin opened this issue Sep 12, 2020 · 2 comments
Assignees

Comments

@ChristopherDosin
Copy link

ChristopherDosin commented Sep 12, 2020

I am trying to login the user within the storefront to buy a product.
But I am getting always The provided CSRF token is not valid from Shopware.

Login Test
it('Login', () => {
        cy.get('.login-collapse-toggle').click()
        cy.get('#loginMail')
            .type('test@example.com')
            .should('have.value', 'test@example.com')
        cy.get('#loginPassword')
            .type('shopware')
        cy.get('.login-form').submit() 
      })
Register Test
    it('Register test customer', () => {

        cy.get('#personalSalutation').select('Mr.')

        cy.get('#personalFirstName')
            .type('Max')
            .should('have.value', 'Max')

        cy.get('#personalLastName')
            .type('Mustermann')
            .should('have.value', 'Mustermann')

        cy.get('#personalGuest').check({force: true})

        cy.get('#personalMail')
            .type('test@test.de')
            .should('have.value', 'test@test.de')

        cy.get('#billingAddressAddressStreet')
            .type('Musterstrasse 1')
            .should('have.value', 'Musterstrasse 1')

        cy.get('#billingAddressAddressZipcode')
            .type('12345')
            .should('have.value', '12345')

        cy.get('#billingAddressAddressCity')
            .type('Musterhausen')
            .should('have.value', 'Musterhausen')

        cy.get('#billingAddressAddressCountry').select('Germany')

        cy.get('#billingAddressAddressCountryState').select('Berlin')

        cy.get('.register-form').submit() 
    })

How can i send a form within the storefront without having the CSRF issue?
I also tried to register a user - But still the same problem with the CSRF token.

@klarstil
Copy link
Contributor

Hey @ChristopherDosin thanks for creating this issue. I'm not aware of any issue regarding CSRF tokens. In our internal CI system which is running every night we're having two E2E specs which are checking the registration and login.

See:

Would you mind checking out and run these specs if you're running into the same problem. I would suspect a local problem here.

Best regards

@klarstil klarstil self-assigned this Sep 15, 2020
@klarstil
Copy link
Contributor

I'm closing this issue due to inactivity. If the issue is still present, please create a new issue and provide a detailed description how to reproduce the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants