Skip to content
Discussion options

You must be logged in to vote

Hey @sycod-maker I pulled down your code and took a look.

The problem is your cors configuration. In the code you have shared, you have this:

    credentials: false

What this does is, it means you're not accepting any http only cookies on requests from the configured origins. This means the cookie gets ignored. If you change this value to true, it works as expected, there is no longer a csrf error.

If you don't want to accept http only cookies, then it doesn't make sense. You only need CSRF protection if you're using http only cookies (typically sessions) for authentication. If you are not using http only cookies for authentication, then you aren't susceptible to CSRF attacks.

https://de…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@sycod-maker
Comment options

@sycod-maker
Comment options

@psibean
Comment options

Answer selected by psibean
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants