Skip to content

Commit 9c86b64

Browse files
authored
Merge pull request #1314 from pi-hole/fix_totp
Fix 2FA examples - TOTP is a number not a string
2 parents 3d1205e + 8db656d commit 9c86b64

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/api/auth.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ If you have 2FA enabled for your Pi-hole, you will need to provide a TOTP token
221221
=== "bash / cURL"
222222

223223
```bash
224-
curl -k -X POST "https://pi.hole/api/auth" --data '{"password":"your-password", "totp":"123456"}'
224+
curl -k -X POST "https://pi.hole/api/auth" --data '{"password":"your-password", "totp":123456}'
225225
```
226226

227227
=== "Python 3"
@@ -243,7 +243,7 @@ If you have 2FA enabled for your Pi-hole, you will need to provide a TOTP token
243243
=== "JavaScript (plain)"
244244

245245
```javascript
246-
var data = JSON.stringify({"password":"your-password", "totp":"123456"});
246+
var data = JSON.stringify({"password":"your-password", "totp":123456});
247247
var xhr = new XMLHttpRequest();
248248

249249
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
259259
$.ajax({
260260
url: "https://pi.hole/api/auth",
261261
type: "POST",
262-
data: JSON.stringify({"password":"your-password", "totp":"123456"}),
262+
data: JSON.stringify({"password":"your-password", "totp":123456}),
263263
dataType: "json",
264264
contentType: "application/json"
265265
}).done(function(data) {

0 commit comments

Comments
 (0)