37

I am trying to integrate Disqus SSO in my site.

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);
})();

Every thing is fine, the payload that is getting generated is also validated correctly on Disqus SSO debug tool. Still the user is not getting signed in using SSO.

And also this message is getting printed on the javascript console:

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

OptimizedQuery
  • 1,262
  • 11
  • 21
ankit
  • 1,499
  • 5
  • 29
  • 46
  • 7
    Im also getting this error. I mean the commenting and stuff works fine but the error is annoying. – MikeeeG May 19 '15 at 13:53
  • 1
    I have a similar problem, here is screen shot of my console http://i.imgur.com/5TFznHk.png – Arian Faurtosh May 28 '15 at 18:58
  • 3
    There is [this bug report](https://disqus.com/home/channel/discussdisqus/discussion/channel-discussdisqus/javascript_error_discovery_bundle/), where Disqus' engineer answered: "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." Are you sure you still have it? If so, could you please post a new stack trace? – sainaen Jun 02 '15 at 16:52

1 Answers1

2

I think you should accept @Sainaen 's comment as answer. I am just elaborating on that as no one else has done that till now. The reference is 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!

I verified and the errors are still coming however they do not effect the system's working in any way whatsoever. This is more of an annoyance rather than an error. Still, it should be fixed because Disqus is too big an entity to ignore these silly warnings. What i would suggest is to mail to them the new stack trace along with any other details you think are important. even i would mail them and let's hope it gets removed. If not, then turn a blind eye towards that. Hope it helps.

Community
  • 1
  • 1
200ok
  • 210
  • 4
  • 14