1

I'm trying to register a new user using:

Backand.signup(firstName, lastName, username, password, password2);

but I end up getting:

XMLHttpRequest cannot load https://api.backand.com/1/user/signup. 
No 'Access-Control-Allow-Origin' header is present on the 
requested resource. Origin 'http://localhost:8100' is therefore 
not allowed access. 
The response had HTTP status code 504.

This endpoint always used to work, with this setup, but it seemed to stop working today. AFAIK, I hit all my endpoints at this url "https://api.backand.com/ doing GET's, PUT's, POST's, etc and they all work as expected. This is the only one showing this behavior.

How could every other endpoint work fine at this url, except for /1/user/signup?

Any help would be appreciated.

sideshowbarker
  • 81,827
  • 26
  • 193
  • 197
cs_pupil
  • 2,782
  • 27
  • 39

1 Answers1

1

As you can see in Backand sdk code in github here,

signup function take an email and not a username.

Is the code:

self.signup = function (firstName, lastName, email, password,confirmPassword, parameters) {
        return BackandAuthService.signup(firstName, lastName, email,
                              password, confirmPassword, parameters);
};

So ensure you send an email and not a simple username.

Another problem can be if you send a password that is less than 6 chars.

You can find detailed error in network tab of chrome.

Ygalbel
  • 5,214
  • 1
  • 24
  • 32
  • Thank you so much for you reply. I was following this tutorial: [link](https://github.com/backand/todos-with-users#saving-additional-parameters-in-the-sign-up) and they refer to email as username, but you are correct. I should've fixed that before posting. Also I was logging replies from the server and whenever there were input issues it returned a reply saying so, so this didn't turn out to be the solution in my case. Oddly enough, after work today, I have not been able to reproduce this behavior. **Itay's answer here: [link](http://stackoverflow.com/a/36189549/3806701) solved my problem.** – cs_pupil Mar 24 '16 at 00:09