Not enough data error : while doing Disqus SSO

Not enough data error : while doing Disqus SSO

我正在尝试将 Disqus SSO 集成到我的站点中。

var DISQUS_SECRET = "xyz";
var DISQUS_PUBLIC = "abc";
var disqus_developer = 1;

function disqusSignon() {
    var disqusData = {
        id: "{{ user.id }}",
        username: "{{ user.username }}",
        email: "{{ user.email }}"
    };

    var disqusStr = JSON.stringify(disqusData);
    var timestamp = Math.round(+new Date() / 1000);
    var message = window.btoa(disqusStr);
    var result = CryptoJS.HmacSHA1(message + " " + timestamp, DISQUS_SECRET);
    var hexsig = CryptoJS.enc.Hex.stringify(result);

    return {
        pubKey: DISQUS_PUBLIC,
        auth: message + " " + hexsig + " " + timestamp
    };
}

var data = disqusSignon();

function disqus_config(){
    this.callbacks.afterRender = [function() {
        this.page.remote_auth_s3 = data.auth;
        this.page.api_key = data.pubKey;
    }];
}

var disqus_config = function() {
    this.page.remote_auth_s3 = data.auth;
    this.page.api_key = data.pubKey;
}

var disqus_shortname = 'askpopulo';
/* * * DON'T EDIT BELOW THIS LINE * * */
(function() {
    var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
    dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
    (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();

一切都很好,正在生成的有效负载也在 Disqus SSO 调试工具上得到了正确验证。用户仍然没有使用 SSO 登录。

并且此消息也在 javascript 控制台上打印:

It looks like there was a problem: Error: Not enough data {stack: (...), message: "Not enough data"}message: "Not enough data"stack: (...)get stack: function () { [native code] }arguments: nullcaller: nulllength: 0name: ""prototype: StackTraceGetter__proto__: function Empty() {}set stack: function () { [native code] }arguments: nullcaller: nulllength: 1name: ""prototype: StackTraceSetter__proto__: function Empty() {}proto: dr.DiscoveryApp.a.Model.extend.onComplete @ discovery.bundle.fce1a5edaced8a1898cef54c2d9fb2bf.js:2(anonymous function) @ common.bundle.91cd39decece4de79b12c1d2e99a09c8.js:9(anonymous function) @ common.bundle.91cd39decece4de79b12c1d2e99a09c8.js:9p @ common.bundle.91cd39decece4de79b12c1d2e99a09c8.js:9o @ common.bundle.91cd39decece4de79b12c1d2e99a09c8.js:9e @ common.bundle.91cd39decece4de79b12c1d2e99a09c8.js:9(anonymous function) @ common.bundle.91cd39decece4de79b12c1d2e99a09c8.js:9(anonymous function) @ common.bundle.91cd39decece4de79b12c1d2e99a09c8.js:9p @ common.bundle.91cd39decece4de79b12c1d2e99a09c8.js:9o @ common.bundle.91cd39decece4de79b12c1d2e99a09c8.js:9c @ common.bundle.91cd39decece4de79b12c1d2e99a09c8.js:9(anonymous function) @ common.bundle.91cd39decece4de79b12c1d2e99a09c8.js:9(anonymous function) @ common.bundle.91cd39decece4de79b12c1d2e99a09c8.js:9p @ common.bundle.91cd39decece4de79b12c1d2e99a09c8.js:9o @ common.bundle.91cd39decece4de79b12c1d2e99a09c8.js:9c @ common.bundle.91cd39decece4de79b12c1d2e99a09c8.js:9(anonymous function) @ common.bundle.91cd39decece4de79b12c1d2e99a09c8.js:9(anonymous function) @ common.bundle.91cd39decece4de79b12c1d2e99a09c8.js:9p @ common.bundle.91cd39decece4de79b12c1d2e99a09c8.j

我认为你应该接受@Sainaen 的评论作为答案。我只是对此进行详细说明,因为到目前为止还没有其他人这样做过。引用是Disqus Bug Report

We checked with our team and these errors aren't a result of any problem so you can safely ignore them. However, were considering hiding them so they don't cause any annoyance. Thanks for reporting!

我已经验证过,错误仍然存​​在,但是它们不会以任何方式影响系统的工作。这与其说是错误,不如说是一种烦恼。不过,它应该得到修复,因为 Disqus 太大了,无法忽略这些愚蠢的警告。我的建议是将新的堆栈跟踪以及您认为重要的任何其他详细信息邮寄给他们。即使我会邮寄它们,但愿它被删除。如果没有,那就对此视而不见。希望对你有帮助。