Conversation
calisio
approved these changes
Nov 6, 2025
Contributor
calisio
left a comment
There was a problem hiding this comment.
looks good and tested good. Thanks!
carddev81
approved these changes
Nov 11, 2025
Contributor
carddev81
left a comment
There was a problem hiding this comment.
Looks and tested great.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of the change
PR Fixes CSRF token missing error in bulk user upload feature. In particular this is a refactoring of the API client to support FormData/file uploads.
Screenshot(s)
Additional context
Root issue: BulkUploadModal component directly used a fetch call to upload CSV files, this bypassed the central API client by default excluding the X-CSRF-Token header that the backend now requires. Rather than adding an entirely separate uploadFile() method I decided upon refactoring the existing fetchWithHandling() method in the API client to automatically detect and handle FormData.
X
I looked through the codebase for other CSRF vulnerabilities or potential issues, I found 10 other direct fetch() calls in the frontend, 9 of 10 are GET requests which don't require CSRF tokens, the other 1 was the BulkUploadModal which was fixed in this PR. So, if there any other CSRF issues, I definitely missed them/it.
Other benefits of this implementation include the fact that now API.put() and API.patch() automatically now support file uploads without any additional code. Now there is a single source of truth for all HTTP request handling.