mirror of
https://github.com/whoswhip/Sharpbin.git
synced 2026-12-06 02:48:43 +00:00
fix: update TOTP API request payload to use 'code' instead of 'totpcode'
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user