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:
faligam
2026-09-06 17:23:11 +02:00
parent c6f1889fe2
commit 8eb0383d48
3 changed files with 13 additions and 12 deletions

View File

@@ -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;