Check for null challenge data and stop trying to solve. Should hopefully get around weird inconsistent states when the forum has KiwiFlare partially enforced

This commit is contained in:
barelyprofessional
2025-08-19 21:48:36 -05:00
parent b2ef7df91b
commit 8d100b013b

View File

@@ -67,6 +67,11 @@ public class KfTokenService
try
{
var challenge = await _kiwiFlare.GetChallenge();
if (challenge == null)
{
_logger.Error("Challenge data was null. Might be KiwiFlare is only partially enabled? Not going to do anything.");
return;
}
var solution = await _kiwiFlare.SolveChallenge(challenge);
var token = await _kiwiFlare.SubmitAnswer(solution);
_cookies.Add(new Cookie("sssg_clearance", token, "/", _kfDomain));