[Dovecot] Fix EAS login and improve logging

This commit is contained in:
FreddleSpl0it
2025-04-15 10:49:56 +02:00
parent 766c5e8580
commit c4d0f35008
2 changed files with 10 additions and 3 deletions
+9 -2
View File
@@ -34,8 +34,15 @@ function auth_password_verify(request, password)
return dovecot.auth.PASSDB_RESULT_INTERNAL_FAILURE, "Upstream error"
end
local api_response = json.decode(table.concat(res))
if api_response.success == true then
local response_str = table.concat(res)
local is_response_valid, response_json = pcall(json.decode, response_str)
if not is_response_valid then
dovecot.i_info("Invalid JSON received: " .. response_str)
return dovecot.auth.PASSDB_RESULT_INTERNAL_FAILURE, "Invalid response format"
end
if response_json.success == true then
return dovecot.auth.PASSDB_RESULT_OK, ""
end