fix: split gemini-token into GET health check + POST token request
All checks were successful
Build & Push / build-and-push (push) Successful in 1m33s

Health check no longer triggers rate limiter, fixing toggle not appearing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-28 14:02:06 +01:00
parent 067164645b
commit b4a265077e
2 changed files with 13 additions and 10 deletions

View File

@@ -24,11 +24,7 @@ export default function ModeToggle({ mode, onChange }: ModeToggleProps) {
if (!navigator.mediaDevices?.getUserMedia) return;
try {
const res = await fetch('/api/gemini-token', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ locale: 'en' }),
});
const res = await fetch('/api/gemini-token');
const data = (await res.json()) as { success: boolean };
if (data.success) setVoiceSupported(true);
} catch {