Try to use the CLI password for logins (if enabled and readable by the current user)

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER
2024-06-19 22:18:11 +02:00
parent ca9eaf9688
commit 520641fa5e
2 changed files with 13 additions and 15 deletions
+4 -12
View File
@@ -128,22 +128,14 @@ Main() {
# Test if the authentication endpoint is available
TestAPIAvailability
# Users can configure FTL in a way, that for accessing a) all endpoints (webserver.api.localAPIauth)
# or b) for the /search endpoint (webserver.api.searchAPIauth) no authentication is required.
# Therefore, we try to query directly without authentication but do authenticat if 401 is returned
# Authenticate with FTL
Authentication
# send query again
data=$(GetFTLData "search/${domain}?N=${max_results}&partial=${partial}")
if [ "${data}" = 401 ]; then
# Unauthenticated, so authenticate with the FTL server required
Authentication
# send query again
data=$(GetFTLData "search/${domain}?N=${max_results}&partial=${partial}")
fi
GenerateOutput "${data}"
DeleteSession
LogoutAPI
}
# Process all options (if present)