diff --git a/frontend/src/app/settings/page.tsx b/frontend/src/app/settings/page.tsx index 7344173..70aa718 100644 --- a/frontend/src/app/settings/page.tsx +++ b/frontend/src/app/settings/page.tsx @@ -111,14 +111,15 @@ export default function SettingsPage() { settings.shorts_oauth_redirect_uri || "https://dylive.nomadro.com/api/shorts/oauth/callback" ); const profiles = Array.isArray(settings.shorts_oauth_profiles) ? settings.shorts_oauth_profiles : []; - body.shorts_oauth_profiles = profiles.map((p: any) => ({ + const oauthProfiles = profiles.map((p: any) => ({ id: String(p.id || "").toUpperCase(), label: String(p.label || ""), client_id: String(p.client_id || ""), client_secret: String(p.client_secret || ""), })); + body.shorts_oauth_profiles = oauthProfiles; // Keep legacy global client in sync with profile A when A is filled - const profA = body.shorts_oauth_profiles.find((p: any) => p.id === "A"); + const profA = oauthProfiles.find((p) => p.id === "A"); if (profA?.client_id) body.shorts_oauth_client_id = profA.client_id; if (profA?.client_secret && !String(profA.client_secret).startsWith("***")) { body.shorts_oauth_client_secret = profA.client_secret;