From 35abb6e7aa267fbb70e4681c811f55a188e2f540 Mon Sep 17 00:00:00 2001
From: Tracewebstudio Dev
Date: Wed, 22 Apr 2026 01:32:43 +0200
Subject: [PATCH] fix: add Authorization header to all dashboard apiFetch
calls; change Buy Credits/Buy Now buttons to BTN_ORANGE
---
.../dashboard/CompanyApplicationsPage.tsx | 10 +++++++++-
src/components/dashboard/CompanyJobsPage.tsx | 10 +++++++++-
.../dashboard/CompanyShortlistedCandidatesPage.tsx | 12 ++++++++++--
src/components/dashboard/CreditsPage.tsx | 14 +++++++++++---
.../dashboard/CustomerRequirementsPage.tsx | 10 +++++++++-
src/components/dashboard/CustomerResponsesPage.tsx | 12 ++++++++++--
src/components/dashboard/ExploreServicesPage.tsx | 12 ++++++++++--
.../dashboard/HelpCenterDashboardPage.tsx | 10 +++++++++-
.../dashboard/JobSeekerApplicationsPage.tsx | 12 ++++++++++--
src/components/dashboard/JobSeekerJobsPage.tsx | 10 +++++++++-
src/components/dashboard/LogoutPage.tsx | 12 ++++++++++--
src/components/dashboard/MyDashboardPage.tsx | 12 ++++++++++--
src/components/dashboard/PortfolioPage.tsx | 12 ++++++++++--
src/components/dashboard/ProfessionalLeadsPage.tsx | 10 +++++++++-
.../dashboard/ProfessionalResponsesPage.tsx | 12 ++++++++++--
src/components/dashboard/ProfilePage.tsx | 10 +++++++++-
src/components/dashboard/SettingsPage.tsx | 12 ++++++++++--
src/components/dashboard/SwitchServicesPage.tsx | 12 ++++++++++--
.../dashboard/VerificationStatusPage.tsx | 12 ++++++++++--
19 files changed, 184 insertions(+), 32 deletions(-)
diff --git a/src/components/dashboard/CompanyApplicationsPage.tsx b/src/components/dashboard/CompanyApplicationsPage.tsx
index a0a1ff9..ec78e18 100644
--- a/src/components/dashboard/CompanyApplicationsPage.tsx
+++ b/src/components/dashboard/CompanyApplicationsPage.tsx
@@ -38,10 +38,18 @@ interface ContactInfo {
}
async function apiFetch(path: string, opts?: RequestInit) {
+ const token =
+ typeof window !== "undefined"
+ ? window.sessionStorage.getItem("nxtgauge_access_token") || ""
+ : "";
return fetch(`${API}${path}`, {
...opts,
credentials: "include",
- headers: { "Content-Type": "application/json", ...(opts?.headers ?? {}) },
+ headers: {
+ "Content-Type": "application/json",
+ ...(token ? { Authorization: `Bearer ${token}` } : {}),
+ ...(opts?.headers ?? {}),
+ },
});
}
diff --git a/src/components/dashboard/CompanyJobsPage.tsx b/src/components/dashboard/CompanyJobsPage.tsx
index 258d64b..0692aaa 100644
--- a/src/components/dashboard/CompanyJobsPage.tsx
+++ b/src/components/dashboard/CompanyJobsPage.tsx
@@ -58,10 +58,18 @@ const EMPTY_FORM: JobFormState = {
};
async function apiFetch(path: string, opts?: RequestInit) {
+ const token =
+ typeof window !== "undefined"
+ ? window.sessionStorage.getItem("nxtgauge_access_token") || ""
+ : "";
return fetch(`${API}${path}`, {
...opts,
credentials: "include",
- headers: { "Content-Type": "application/json", ...(opts?.headers ?? {}) },
+ headers: {
+ "Content-Type": "application/json",
+ ...(token ? { Authorization: `Bearer ${token}` } : {}),
+ ...(opts?.headers ?? {}),
+ },
});
}
diff --git a/src/components/dashboard/CompanyShortlistedCandidatesPage.tsx b/src/components/dashboard/CompanyShortlistedCandidatesPage.tsx
index c7a494a..b969f93 100644
--- a/src/components/dashboard/CompanyShortlistedCandidatesPage.tsx
+++ b/src/components/dashboard/CompanyShortlistedCandidatesPage.tsx
@@ -14,10 +14,18 @@ type ApplicationItem = {
};
async function apiFetch(path: string, opts?: RequestInit) {
+ const token =
+ typeof window !== "undefined"
+ ? window.sessionStorage.getItem("nxtgauge_access_token") || ""
+ : "";
return fetch(`${API}${path}`, {
...opts,
- credentials: 'include',
- headers: { 'Content-Type': 'application/json', ...(opts?.headers ?? {}) },
+ credentials: "include",
+ headers: {
+ "Content-Type": "application/json",
+ ...(token ? { Authorization: `Bearer ${token}` } : {}),
+ ...(opts?.headers ?? {}),
+ },
});
}
diff --git a/src/components/dashboard/CreditsPage.tsx b/src/components/dashboard/CreditsPage.tsx
index 78de671..96af5dc 100644
--- a/src/components/dashboard/CreditsPage.tsx
+++ b/src/components/dashboard/CreditsPage.tsx
@@ -34,10 +34,18 @@ type CheckoutState = {
};
async function apiFetch(path: string, opts?: RequestInit) {
+ const token =
+ typeof window !== "undefined"
+ ? window.sessionStorage.getItem("nxtgauge_access_token") || ""
+ : "";
return fetch(`${API}${path}`, {
...opts,
credentials: "include",
- headers: { "Content-Type": "application/json", ...(opts?.headers ?? {}) },
+ headers: {
+ "Content-Type": "application/json",
+ ...(token ? { Authorization: `Bearer ${token}` } : {}),
+ ...(opts?.headers ?? {}),
+ },
});
}
@@ -770,7 +778,7 @@ export default function CreditsPage(props: Props) {
-