Fix demo status API call using wrong base URL

getDemoStatus was using the /api/v1 axios client, so it called
/api/v1/demo/status which 404s. The endpoint is at /demo/status with
no prefix. Switch to plain axios so useDemoMode() returns true correctly
and all demo guards (2FA, password, backups) actually work.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
megaproxy 2026-04-23 23:34:33 +00:00
parent 3126b103b1
commit 0e3ae3b81a

View file

@ -1,6 +1,6 @@
import { api } from "./client";
import axios from "axios";
export async function getDemoStatus(): Promise<{ demo_mode: boolean }> {
const r = await api.get<{ demo_mode: boolean }>("/demo/status");
const r = await axios.get<{ demo_mode: boolean }>("/demo/status");
return r.data;
}