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

Correct api fixtures #2456

Merged
merged 2 commits into from
Feb 12, 2015

Conversation

michalmarcinkowski
Copy link
Contributor

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Fixed tickets
License MIT
Doc PR

When ROLE_API is assigned the csrf token is disabled and it causes exception in the backend.

Method "_token" for object "Symfony\Component\Form\FormView" does not exist

Removed csrf token disable from config, it is handled by ResourceController.

Added fixtures to create new user with ROLE_API for api tests.

pjedrzejewski pushed a commit that referenced this pull request Feb 12, 2015
@pjedrzejewski pjedrzejewski merged commit c9dbc3f into Sylius:master Feb 12, 2015
@pjedrzejewski
Copy link
Member

Thanks Mr. Michal! 👍

@stloyd
Copy link
Contributor

stloyd commented Feb 12, 2015

For this looks wrong. The cause of that issue was that you have added role ROLE_API to the normal users, IIRC this was never planned to do it that way.

Removal of disable_csrf_role: ROLE_API will probably break (with CSRF error) any stateless call to the API isn't it?

@pjedrzejewski
Copy link
Member

@stloyd It won't, because for api requests we disable csrf anyway. We need to look at this to preoperly use this role. The problem was that you can add such role in the backend and it breaks whole backend, because csrf is disabled.

@michalmarcinkowski michalmarcinkowski deleted the api-client-fixtures branch March 12, 2015 11:48
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

Successfully merging this pull request may close these issues.

3 participants