mirror of
https://github.com/siteboon/claudecodeui.git
synced 2026-01-25 02:47:31 +00:00
fix: settings api calls that would fail.
This commit is contained in:
@@ -1,15 +1,16 @@
|
||||
// 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 = {
|
||||
'Content-Type': 'application/json',
|
||||
};
|
||||
|
||||
if (token) {
|
||||
|
||||
if (!isPlatform && token) {
|
||||
defaultHeaders['Authorization'] = `Bearer ${token}`;
|
||||
}
|
||||
|
||||
|
||||
return fetch(url, {
|
||||
...options,
|
||||
headers: {
|
||||
|
||||
Reference in New Issue
Block a user