mirror of
https://github.com/pi-hole/docs.git
synced 2026-02-14 23:18:30 +00:00
Fix 2FA examples - TOTP is a number not a string
Signed-off-by: yubiuser <github@yubiuser.dev>
This commit is contained in:
@@ -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"
|
||||||
|
|
||||||
```bash
|
```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"
|
=== "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 (plain)"
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
var data = JSON.stringify({"password":"your-password", "totp":"123456"});
|
var data = JSON.stringify({"password":"your-password", "totp":123456});
|
||||||
var xhr = new XMLHttpRequest();
|
var xhr = new XMLHttpRequest();
|
||||||
|
|
||||||
xhr.addEventListener("readystatechange", function () {
|
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({
|
$.ajax({
|
||||||
url: "https://pi.hole/api/auth",
|
url: "https://pi.hole/api/auth",
|
||||||
type: "POST",
|
type: "POST",
|
||||||
data: JSON.stringify({"password":"your-password", "totp":"123456"}),
|
data: JSON.stringify({"password":"your-password", "totp":123456}),
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
contentType: "application/json"
|
contentType: "application/json"
|
||||||
}).done(function(data) {
|
}).done(function(data) {
|
||||||
|
|||||||
Reference in New Issue
Block a user