Fix qB auth/login to always return plain text

This commit is contained in:
Antonin Lenfant-Kodia 2026-03-01 15:01:13 +01:00
parent 371a13e060
commit a7dd01eb42

View file

@ -24,22 +24,22 @@ public class QBittorrentController(ILogger<QBittorrentController> logger, QBitto
if (Settings.Get.General.AuthenticationType == AuthenticationType.None) if (Settings.Get.General.AuthenticationType == AuthenticationType.None)
{ {
return Ok("Ok."); return Content("Ok.", "text/plain");
} }
if (String.IsNullOrWhiteSpace(request.UserName) || String.IsNullOrEmpty(request.Password)) if (String.IsNullOrWhiteSpace(request.UserName) || String.IsNullOrEmpty(request.Password))
{ {
return Ok("Fails."); return Content("Fails.", "text/plain");
} }
var result = await qBittorrent.AuthLogin(request.UserName, request.Password); var result = await qBittorrent.AuthLogin(request.UserName, request.Password);
if (result) if (result)
{ {
return Ok("Ok."); return Content("Ok.", "text/plain");
} }
return Ok("Fails."); return Content("Fails.", "text/plain");
} }
[AllowAnonymous] [AllowAnonymous]