From 8db656d8b3c1ead9f326722a188675af36653e33 Mon Sep 17 00:00:00 2001 From: yubiuser Date: Thu, 20 Nov 2025 21:17:34 +0100 Subject: [PATCH] Fix 2FA examples - TOTP is a number not a string Signed-off-by: yubiuser --- docs/api/auth.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/api/auth.md b/docs/api/auth.md index 944c5b2..db8125c 100644 --- a/docs/api/auth.md +++ b/docs/api/auth.md @@ -221,7 +221,7 @@ If you have 2FA enabled for your Pi-hole, you will need to provide a TOTP token === "bash / cURL" ```bash - curl -k -X POST "https://pi.hole/api/auth" --data '{"password":"your-password", "totp":"123456"}' + curl -k -X POST "https://pi.hole/api/auth" --data '{"password":"your-password", "totp":123456}' ``` === "Python 3" @@ -243,7 +243,7 @@ If you have 2FA enabled for your Pi-hole, you will need to provide a TOTP token === "JavaScript (plain)" ```javascript - var data = JSON.stringify({"password":"your-password", "totp":"123456"}); + var data = JSON.stringify({"password":"your-password", "totp":123456}); var xhr = new XMLHttpRequest(); xhr.addEventListener("readystatechange", function () { @@ -259,7 +259,7 @@ If you have 2FA enabled for your Pi-hole, you will need to provide a TOTP token $.ajax({ url: "https://pi.hole/api/auth", type: "POST", - data: JSON.stringify({"password":"your-password", "totp":"123456"}), + data: JSON.stringify({"password":"your-password", "totp":123456}), dataType: "json", contentType: "application/json" }).done(function(data) {