mirror of
https://github.com/siteboon/claudecodeui.git
synced 2026-02-01 22:37:33 +00:00
refactor: Use IS_PLATFORM constant for platform detection in authenticatedFetch function (backend)
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
|
import { IS_PLATFORM } from "../../shared/modelConstants";
|
||||||
|
|
||||||
// Utility function for authenticated API calls
|
// Utility function for authenticated API calls
|
||||||
export const authenticatedFetch = (url, options = {}) => {
|
export const authenticatedFetch = (url, options = {}) => {
|
||||||
const isPlatform = import.meta.env.VITE_IS_PLATFORM === 'true';
|
|
||||||
const token = localStorage.getItem('auth-token');
|
const token = localStorage.getItem('auth-token');
|
||||||
|
|
||||||
const defaultHeaders = {};
|
const defaultHeaders = {};
|
||||||
@@ -10,7 +11,7 @@ export const authenticatedFetch = (url, options = {}) => {
|
|||||||
defaultHeaders['Content-Type'] = 'application/json';
|
defaultHeaders['Content-Type'] = 'application/json';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isPlatform && token) {
|
if (!IS_PLATFORM && token) {
|
||||||
defaultHeaders['Authorization'] = `Bearer ${token}`;
|
defaultHeaders['Authorization'] = `Bearer ${token}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user