Skip to content

fix: add Authorization header to Records page API calls#112

Open
vishn9893 wants to merge 1 commit into
VariantConst:mainfrom
vishn9893:fix/records-page-auth-header
Open

fix: add Authorization header to Records page API calls#112
vishn9893 wants to merge 1 commit into
VariantConst:mainfrom
vishn9893:fix/records-page-auth-header

Conversation

@vishn9893

Copy link
Copy Markdown

Title: fix: add Authorization header to Records page API calls

Description:

Problem

The Records page (/records) was making API calls to /api/v1/panel/records and /api/v1/panel/records/export without an Authorization header. The middleware requires a Bearer token for all /api/v1/panel/* routes, causing both calls to return 401 Unauthorized — resulting in an empty records table and a broken export button.

Fix

Read the access_token from localStorage (consistent with how the Panel/Usage page handles auth) and include it as Authorization: Bearer <token> in both:

  • fetchRecords — so the records table loads correctly
  • handleExport — so the CSV export button works

Testing

  • Records table now loads data correctly on the /records page
  • Export button downloads a valid usage_records_<date>.csv file
  • Verified against a PostgreSQL instance with 1,162+ usage records

@vercel

vercel Bot commented Jun 23, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the variantconst's projects Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant