cyntler / cyntler/react-doc-viewer
Add cookie with react-doc-viewer
- Dominant language
- TypeScript
- Stars
- 481
- Forks
- 147
- PR merge metrics
- No merged PRs in 30d
Description
I'm encountering a 401 error when trying to display source files (such as DOCX or text files) in my React app using the react-doc-viewer component. The error occurs during the request to my API, and I suspect it's because the cookie is not being sent along with the request.
Scenario: I have integrated the react-doc-viewer component into my React app to enable users to view source files. However, when making the request to my API endpoint, I receive a 401 error indicating an authentication issue.
Authentication Issue: Upon further investigation, I discovered that the cookie is not being sent to my API along with the request. The API relies on the presence of the cookie for authentication, and without it, the request is considered unauthorized.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by tracing how react-doc-viewer requests source files from the API and inspect the request path for cookie handling. Confirm the expected authentication behavior and test that the API receives the cookie so the documented 401 scenario no longer occurs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- authentication, frontend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100