Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Use IsCsrfTokenValid Attribute #1564

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

Open
seb-jean wants to merge 1 commit into symfony:main
base: main
Choose a base branch
Loading
from seb-jean:iscsrftokenvalid-attribute

Conversation

@seb-jean
Copy link
Contributor

@seb-jean seb-jean commented Feb 21, 2025

This will allow the use of IsCsrfTokenValid Attribute but we lose the redirection when the csrk token is not valid.
What do you think?

Copy link
Contributor

94noni commented Feb 26, 2025

not commenting for the PR changes but cant this redirect feature be implemented upstream ?
for ex a code with:

#[Route('/entity/{id}')]
public function show(Entity $entity): Response

returns a 404, can this attribute propose a way to return a specific response status code ?

Copy link
Member

I was going to merge this ... but I tested it again and now I'm not sure.

With the new code, when there's a CSRF token exception the user is redirected to the public blog index instead of the blog admin page. It's pretty confusing 😐

Copy link
Contributor Author

Yes, indeed. We have no control over this behavior.

Copy link
Member

stof commented May 19, 2025

There is a discussion about it in symfony/symfony#57343

seb-jean reacted with thumbs up emoji

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /