-
Notifications
You must be signed in to change notification settings - Fork 433
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
CSRF bugfix #2838
CSRF bugfix #2838
Conversation
…-to-all-requests-7.2
…-to-all-requests-7.4
…-to-all-requests-7.6-next
…-to-all-requests-7.2
…-to-all-requests-7.4
…-to-all-requests-7.6-next
….6-next' into w2p-111801_CSRF-bugfix-7.6
Hi @Atmire-Kristof, |
@Atmire-Kristof and @artlowel : This has been replaced by #2886 (which was just merged). I cherry-picked the main commit from this PR (5f52e69) to fix a bug we were having in e2e tests (the e2e tests were having this same issue where the CSRF token was not always pre-initialized before the first non-GET request). So, I believe this PR is now obsolete and can be closed. Your changes have been applied to NOTE: I have NOT yet ported the changes to |
Closing as I've tested further and verified this is fixed by #2886 |
References
Description
This PR adds a
/api/security/csrf
endpoint to send POST requests to, which returns the appropriate CSRF headers/cookies, avoiding any subsequent POST request from failing before CSRF headers are set.Instructions for Reviewers
Changes made:
XSRFService
will send out a POST request to the new csrf endpoint (browser-side, since server-side can only send GET requests)For testing, I'd advise setting up both Angular and REST side of this PR (note, when referring to csrf cookie, I'm talking about "DSPACE-XSRF-COOKIE"):
Checklist
This checklist provides a reminder of what we are going to look for when reviewing your PR. You need not complete this checklist prior to creating your PR (draft PRs are always welcome). If you are unsure about an item in the checklist, don't hesitate to ask. We're here to help!
yarn lint
yarn check-circ-deps
)package.json
), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.