Fix API-key login and research navigation
Validate submitted keys against the protected research endpoint instead of the nonexistent versioned health path. Replace server-only redirects in client code with SvelteKit navigation and route successful logins to the existing new-research screen. Align frontend research history and creation calls with the backend response contract: list items are wrapped in items and new runs return research_id.
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
<script lang="ts">
|
||||
import { redirect } from '@sveltejs/kit';
|
||||
import { isAuthenticated } from '$lib/auth';
|
||||
import { createResearch } from '$lib/sidebar';
|
||||
import { errorBanners } from '$lib/components/ErrorBannerStore';
|
||||
@@ -46,7 +45,7 @@
|
||||
try {
|
||||
const result = await createResearch(key, query.trim(), language, depth);
|
||||
errorBanners.addErrorSuccess('Research wird erstellt…');
|
||||
window.location.href = `/research/${result.id}`;
|
||||
window.location.href = `/research/${result.research_id}`;
|
||||
} catch (e) {
|
||||
const msg = e instanceof Error ? e.message : 'Fehler beim Erstellen der Recherche.';
|
||||
error = msg;
|
||||
|
||||
Reference in New Issue
Block a user