Skip to content

Bug: History page fetches records without sending Authorization header #18

@pericharlabindhumadhavi-data

Description

Describe the bug
The app uses JWT authentication — login saves a token to localStorage.
But the history page fetches /api/history with no Authorization header:

const response = await fetch(`${apiUrl}/api/history`);

This means either:

  • All patient records are publicly accessible without login, or
  • The request is silently rejected and the table shows empty

Both are broken — one is a security risk, one is a silent failure.

Where is it happening
src/app/history/page.tsxfetchHistory function

Expected behavior
The JWT token from localStorage should be sent with every authenticated request.

I would like to work on this issue under GSSoC.
Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions