mirror of
https://github.com/barelyprofessional/KfChatDotNet.git
synced 2026-05-02 04:22:04 -04:00
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:
@@ -67,6 +67,11 @@ public class KfTokenService
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
var challenge = await _kiwiFlare.GetChallenge();
|
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 solution = await _kiwiFlare.SolveChallenge(challenge);
|
||||||
var token = await _kiwiFlare.SubmitAnswer(solution);
|
var token = await _kiwiFlare.SubmitAnswer(solution);
|
||||||
_cookies.Add(new Cookie("sssg_clearance", token, "/", _kfDomain));
|
_cookies.Add(new Cookie("sssg_clearance", token, "/", _kfDomain));
|
||||||
|
|||||||
Reference in New Issue
Block a user