Exemplo n.º 1
0
    private static void VerifyAuthCookies(CookieCollection usersCookies, params string[] cookieNames)
    {
        if (!usersCookies.Any())
        {
            throw new FplApiException("No cookies returned!");
        }

        foreach (var cookieName in cookieNames)
        {
            if (!usersCookies.Any(c => c.Name == cookieName))
            {
                var allCookies = string.Join("\n", usersCookies.OrderBy(c => c.Domain).Select(c => $"[{c.Domain}]{c.Name} : {c.Value}"));
                var error      = $"Missing {cookieName} cookie! Cookies :\n{allCookies}";
                throw new FplApiException(error);
            }
        }
    }
Exemplo n.º 2
0
 public override bool VerifyCookieAndSave(CookieCollection ccol)
 {
     return(ccol.Any(cookie => cookie.Name.Equals("cf_clearance", StringComparison.OrdinalIgnoreCase)));
 }
Exemplo n.º 3
0
 public override bool VerifyCookieAndSave(CookieCollection ccol)
 {
     return(CustomConfig.CookieLoginAuthKey == null || ccol.Any(cookie => cookie.Name.Equals(CustomConfig.CookieLoginAuthKey, StringComparison.OrdinalIgnoreCase)));
 }