Start a new topic

Internal Server Error using Twitter Sign Up

I am trying to setup the Pay It Forward sample app with a slight modification to use twitter instead of facebook. When I click the Sign up button I get an Internal Server Error 500:

POST https://baas.kinvey.com/user/kid_PVUyQAskiO/?provider=twitter&step=requestToken&_=3m04ktz2cwfav2t9 500 (Internal Server Error)



All I changed in the sample code is the app key and secret and app.js line 156 to:

Kinvey.Social.connect(null, 'twitter').then(function() {



Where is the problem?

What is in the response body? There should be an indication of what went wrong.
{"error":"BLTimeoutError","description":"The Business Logic script did not complete. Please contact support","debug":"The script was terminated due to timing constraints: took more than 2000ms to complete. Did you forget to call response.complete() or response.continue()?"}
Since the BL script performs a request to (in your case) Twitter, it might be Twitter sometimes doesn’t respond quickly enough (i.e. within 2 seconds). In that case, the script times out.



Does this happen incidentally or very often?
this happens every time
Please make sure the [BL script](http://devcenter.kinvey.com/html5/tutorials/how-to-implement-safe-signin-via-oauth#AddBusinessLogic) is pasted correctly. The script in the tutorial replaces the *entire* hook, and should *not* be pasted in the onPreSave hook.



So, the following won’t work:

function onPreSave(request, response, modules) {

// BL script here.

};



The following will work:

// BL script here.
Login or Signup to post a comment