Merge pull request #941 from ALenfant/fix_login_format

Always return plain text from `auth/login` API endpoint
This commit is contained in:
Roger Far 2026-03-01 10:38:37 -07:00 committed by GitHub
commit 7ec977b36e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -35,22 +35,22 @@ public class QBittorrentController(ILogger<QBittorrentController> logger, QBitto
if (Settings.Get.General.AuthenticationType == AuthenticationType.None)
{
return Ok("Ok.");
return Content("Ok.", "text/plain");
}
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);
if (result)
{
return Ok("Ok.");
return Content("Ok.", "text/plain");
}
return Ok("Fails.");
return Content("Fails.", "text/plain");
}
[AllowAnonymous]