Dan Levy
Dan Levy

Reputation: 4281

ParseTwitterUtils Internal Server Error

I just finished up movie my app over to Parse Server. I've got everything working except for my Twitter Login and Signup. When I login or signup, I get an Internal Server Error message printed to my console. I am using the latest Parse SDK. Here is my login code (my signup code is similar, it just gets other data from the Twitter API and stores it to my database):

PFTwitterUtils.logInWithBlock {
            (user: PFUser?, error: NSError?) -> Void in

            if let user = user {

                if user.isNew {

                    spinningActivity.hideAnimated(true)

                    PFUser.currentUser()?.deleteInBackground()

                    self.displayNoticeWithTwoActions("Account Not Found", message: "This Twitter account is not in our system. You have to sign up first.", firstButtonTitle: "Sign Up", closeButtonTitle: "Ok", segue: "dontHaveAccountSegue")


                } else if error != nil {

                   spinningActivity.hideAnimated(true)

                    self.displayError("Error", message: error!.localizedDescription)

                } else {

                    spinningActivity.hideAnimated(true)
                    self.performSegueWithIdentifier("successfulLoginSegue", sender: self)

                }


            } else {

                spinningActivity.hideAnimated(true)


                self.displayError("Error", message: "Unless you tapped on 'Cancel' or 'Done', something went wrong. Please try again.")

            }
        }

The only thing I could find online is that it could be a problem on Twitter's end...I made sure my consumer key and secret were right in my AppDelegate. Any ideas?

Upvotes: 0

Views: 233

Answers (1)

pbush25
pbush25

Reputation: 5248

To your index.js file that is your config file for Parse Server, you'll need to add this:

var api = new ParseServer ({
    databaseURI: xxxxxxx,
    cloud: xxxxxx,
    appID: xxxxxx,
    //more keys
    //add oauth keys
    oauth: {
         facebook: {
             appIds: xxxxxxxxxxxxx
         },
         twitter: {
             appIds: xxxxxxxxxxxxx
         }
   }
})

Upvotes: 2

Related Questions