fix: onboarding endpoints send token secret (#4575)
This commit is contained in:
@@ -1,24 +1,17 @@
|
||||
import { startOpenrouterSetup } from '../api';
|
||||
|
||||
export interface OpenRouterSetupStatus {
|
||||
isRunning: boolean;
|
||||
error: string | null;
|
||||
}
|
||||
|
||||
export async function startOpenRouterSetup(): Promise<{ success: boolean; message: string }> {
|
||||
const baseUrl = `${window.appConfig.get('GOOSE_API_HOST')}:${window.appConfig.get('GOOSE_PORT')}`;
|
||||
const response = await fetch(`${baseUrl}/handle_openrouter`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
console.error('Failed to start Openrouter setup:', response.statusText);
|
||||
try {
|
||||
return (await startOpenrouterSetup({ throwOnError: true })).data;
|
||||
} catch (e) {
|
||||
return {
|
||||
success: false,
|
||||
message: `Failed to start Openrouter setup ['${response.status}]`,
|
||||
message: `Failed to start Openrouter setup ['${e}]`,
|
||||
};
|
||||
}
|
||||
|
||||
return await response.json();
|
||||
}
|
||||
|
||||
@@ -1,25 +1,17 @@
|
||||
import { startTetrateSetup as startTetrateSetupApi } from '../api';
|
||||
|
||||
export interface TetrateSetupStatus {
|
||||
isRunning: boolean;
|
||||
error: string | null;
|
||||
}
|
||||
|
||||
export async function startTetrateSetup(): Promise<{ success: boolean; message: string }> {
|
||||
const baseUrl = `${window.appConfig.get('GOOSE_API_HOST')}:${window.appConfig.get('GOOSE_PORT')}`;
|
||||
const response = await fetch(`${baseUrl}/handle_tetrate`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
console.error('Failed to start Tetrate setup:', response.statusText);
|
||||
try {
|
||||
return (await startTetrateSetupApi({ throwOnError: true })).data;
|
||||
} catch (e) {
|
||||
return {
|
||||
success: false,
|
||||
message: `Failed to start Tetrate setup ['${response.status}]`,
|
||||
message: `Failed to start Tetrate setup ['${e}]`,
|
||||
};
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user