final delete

This commit is contained in:
dev.daminik00 2025-09-13 22:17:12 +02:00
parent ab02108a20
commit 901a044b7d
2 changed files with 1 additions and 20 deletions

View File

@ -91,13 +91,7 @@ class HttpClient {
// ignore
}
}
if (accessToken) {
headers.set("Authorization", `Bearer ${accessToken}`);
console.log("🔑 Token being sent:", accessToken.substring(0, 20) + "...");
} else {
console.log("❌ No access token found!");
}
if (accessToken) headers.set("Authorization", `Bearer ${accessToken}`);
headers.set("Content-Type", "application/json");
const res = await fetch(fullUrl, {

View File

@ -8,25 +8,12 @@ export async function getServerAccessToken() {
export function getClientAccessToken(): string | undefined {
if (typeof window === "undefined") return undefined;
// eslint-disable-next-line no-console
console.log("🍪 Debug cookies:", document.cookie);
const cookies = document.cookie.split(";");
// eslint-disable-next-line no-console
console.log("🍪 All cookies:", cookies);
const accessTokenCookie = cookies.find(cookie =>
cookie.trim().startsWith("accessToken=")
);
// eslint-disable-next-line no-console
console.log("🍪 Found accessToken cookie:", accessTokenCookie);
if (!accessTokenCookie) return undefined;
// Use substring instead of split to handle tokens with = signs
const token = accessTokenCookie.trim().substring("accessToken=".length);
// eslint-disable-next-line no-console
console.log("🍪 Extracted token:", token.substring(0, 20) + "...");
return token;
}