login: boolean parser: also accept "1" and "0" as strings

since that's what the pve api sometimes returns for booleans

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2024-09-27 14:06:09 +02:00 committed by Wolfgang Bumiller
parent 7379bdfb9c
commit eb3dd9453b

View File

@ -94,11 +94,13 @@ where
let value = if value.eq_ignore_ascii_case("true")
|| value.eq_ignore_ascii_case("yes")
|| value.eq_ignore_ascii_case("on")
|| value == "1"
{
true
} else if value.eq_ignore_ascii_case("false")
|| value.eq_ignore_ascii_case("no")
|| value.eq_ignore_ascii_case("off")
|| value == "0"
{
false
} else {