mirror of
https://github.com/pi-hole/FTL.git
synced 2024-10-26 16:52:18 +02:00
Tests: No login needed when there is no password
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
@@ -703,7 +703,15 @@
|
||||
[[ ${lines[0]} == "Error 404: Not Found" ]]
|
||||
}
|
||||
|
||||
@test "API authorization: Getting challenge" {
|
||||
@test "API authorization (without password): No login required" {
|
||||
run bash -c 'curl -s 127.0.0.1:8080/api/auth'
|
||||
printf "%s\n" "${lines[@]}"
|
||||
[[ ${lines[0]} == '{"session":{"valid":true,"sid":null,"validity":null}}' ]]
|
||||
}
|
||||
|
||||
@test "API authorization (with password): FTL challenges us" {
|
||||
# Password: ABC
|
||||
echo "WEBPASSWORD=183c1b634da0078fcf5b0af84bdcbb3e817708c3f22b329be84165f4bad1ae48" >> /etc/pihole/setupVars.conf
|
||||
run bash -c 'curl -s 127.0.0.1:8080/api/auth'
|
||||
printf "%s\n" "${lines[@]}"
|
||||
[[ ${lines[0]} == "{\"challenge\":\""* ]]
|
||||
|
||||
Reference in New Issue
Block a user