mirror of
https://github.com/siteboon/claudecodeui.git
synced 2026-01-31 13:57:34 +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
|
||||
export const authenticatedFetch = (url, options = {}) => {
|
||||
const isPlatform = import.meta.env.VITE_IS_PLATFORM === 'true';
|
||||
const token = localStorage.getItem('auth-token');
|
||||
|
||||
const defaultHeaders = {};
|
||||
@@ -10,7 +11,7 @@ export const authenticatedFetch = (url, options = {}) => {
|
||||
defaultHeaders['Content-Type'] = 'application/json';
|
||||
}
|
||||
|
||||
if (!isPlatform && token) {
|
||||
if (!IS_PLATFORM && token) {
|
||||
defaultHeaders['Authorization'] = `Bearer ${token}`;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user