-
Notifications
You must be signed in to change notification settings - Fork 0
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
chore: send csrf token when submitting a rpc2.0 call #714
Conversation
- mainly to prevent the purple error messages about missing csrf tokens when loading addons
src/lib/DpApi.js
Outdated
} | ||
} | ||
|
||
const apiDefaultHeaders = { | ||
'X-JWT-Authorization': 'Bearer ' + jwtToken | ||
'X-JWT-Authorization': 'Bearer ' + jwtToken, | ||
'X-Csrf-Token': csrfToken |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better use small caps like x-csrf-token
for new headers as they should be only small chars in http2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah thanks, indeed i remember the slack discussion. done here 6432cf4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, thx
} | ||
} | ||
|
||
const apiDefaultHeaders = { | ||
'X-JWT-Authorization': 'Bearer ' + jwtToken | ||
'X-JWT-Authorization': 'Bearer ' + jwtToken, | ||
'x-csrf-token': csrfToken |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is the new header only added to apiDefaultHeaders, not api2defaultHeaders (which is used on all 2.0 routes)?
@@ -4,6 +4,10 @@ Since v0.0.10, this Changelog is formatted according to the [Common Changelog][c | |||
|
|||
## UNRELEASED | |||
|
|||
### Added | |||
|
|||
- ([#714](https://github.com/demos-europe/demosplan-ui/pull/714/files)) add csrf token to dpRpc to prevent missing csrf errors ([@muellerdemos](https://github.com/muellerdemos)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in fact this adds the headers to both dpApi and dpRpc calls.
Description
Linked PRs:
demos-europe/demosplan-core#2586
Important:
Before removing the hidden input field throughout dplan this PR needs to be merged first and a new release is needed