Skip to content

can't create new user from cloud code running on Parse Server (on aws). I get 107 parse error code and nginx/1.10.1 Bad Request. on localhost it works. #3345

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Tomersteps opened this issue Jan 9, 2017 · 4 comments

Comments

@Tomersteps
Copy link

Tomersteps commented Jan 9, 2017

this is my code:

var tempPass = genRandomPass();
var user = new Parse.User({
    username: email,
    password: tempPass,
  });

user.signUp(null, {
    useMasterKey: true,
    success: function (createdUser) {
      var link = inviteLink(email, tempPass, physio.get('lang'));
      sendInvitationEmail(email, physio, details, tempPass, {
        success: function (httpResponse) {
          console.log("User " + createdUser.id + " created, and sent email: " + httpResponse.status);
          response.success({
            user: createdUser,
            inviteLink: querystring.escape(link)
          });
        },
        error: function (httpResponse) {
          console.error("user " + createdUser.id + " created, but couldn't email them. " + httpResponse.status + " " + httpResponse.text);
          response.error({
            msg: "user " + createdUser.id + " created, but couldn't email them. " + httpResponse.status,
            inviteLink: querystring.escape(link)
          });
        }
      });
    },
    error: function (_user, error) {
      response.error("parse error: couldn't create user " + error.code + " " + error.message);
    }
  });

my db is mongodb (on mLab). I get the last error from the code - "parse error: couldn't create user... Received an error with invalid JSON from Parse... Bad Request".
@Tomersteps Tomersteps changed the title can't create new user from cloud code running on aws. I get Bad Request. on localhost it works. can't create new user from cloud code running on Parse Server (on aws). I get Bad Request. on localhost it works. Jan 9, 2017
@Tomersteps Tomersteps changed the title can't create new user from cloud code running on Parse Server (on aws). I get Bad Request. on localhost it works. can't create new user from cloud code running on Parse Server (on aws). I get 107 parse error code and nginx/1.10.1 Bad Request. on localhost it works. Jan 10, 2017
@Tomersteps Tomersteps reopened this Jan 10, 2017
@natanrolnik
Copy link
Contributor

@Tomersteps can you please indent your code and format the markdown correctly?

@Tomersteps
Copy link
Author

I hope it's ok now. I think the problem is that I need to enable CORS on nginx. I tried to do it but with no success..

@Tomersteps
Copy link
Author

When I resend the request using Firefox an OPTION request is made that returns 200 and in the console it says:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://my-parse-server-on-aws/parse/functions/cloudFunction. (Reason: missing token ‘cache-control’ in CORS header ‘Access-Control-Allow-Headers’ from CORS preflight channel).

@hramos
Copy link
Contributor

hramos commented Feb 10, 2017

Thanks for your question!

We want to make sure to keep signal strong in the GitHub issue tracker – to make sure that it remains the best place to track issues that affect the development of Parse Server.

Questions like yours deserve a purpose-built Q&A forum. Would you like to post this question to Stack Overflow with the tag #parse.com? We'll be happy to answer there. Post a link to your Stack Overflow question here, so that we don't lose track of it.

You may also use Server Fault for questions about managing your own servers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants