Esempio n. 1
0
    private AntiforgeryToken?GetCookieTokenDoesNotThrow(HttpContext httpContext)
    {
        try
        {
            var serializedToken = _tokenStore.GetCookieToken(httpContext);

            if (serializedToken != null)
            {
                var token = _tokenSerializer.Deserialize(serializedToken);
                return(token);
            }
        }
        catch (Exception ex)
        {
            // ignore failures since we'll just generate a new token
            _logger.TokenDeserializeException(ex);
        }

        return(null);
    }
 public string GetCookieToken(HttpContext httpContext)
 {
     // Default implementation
     return(_defaultStore.GetCookieToken(httpContext));
 }