fix: update TOTP API request payload to use 'code' instead of 'totpcode'

This commit is contained in:
2026-01-07 16:41:10 -05:00
parent 20ceb91db8
commit 6bcc62a7e7
@@ -161,7 +161,7 @@
const res = await fetch('/api/auth/totp/enable', { const res = await fetch('/api/auth/totp/enable', {
method: 'POST', method: 'POST',
headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${token}` }, headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${token}` },
body: JSON.stringify({ secret: totpSecret, totpcode: code }) body: JSON.stringify({ secret: totpSecret, code: code })
}); });
if (!res.ok) { if (!res.ok) {
const data = await res.json().catch(() => null); const data = await res.json().catch(() => null);
@@ -184,7 +184,7 @@
const res = await fetch('/api/auth/totp/disable', { const res = await fetch('/api/auth/totp/disable', {
method: 'POST', method: 'POST',
headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${token}` }, headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${token}` },
body: JSON.stringify({ totpcode: code }) body: JSON.stringify({ code: code })
}); });
if (!res.ok) { if (!res.ok) {
const data = await res.json().catch(() => null); const data = await res.json().catch(() => null);