I am using backendless js sdk for a web application. I have successfully initialized the backend with the application key and the secret key. Now try purposely to log into the application with wrong credentials to see what is the error message in this case. But the call fails with “unknown error occurd” status code 0.
var APPLICATION_ID = 'app_key_id',
SECRET_KEY = 'secret_key_id,
VERSION = 'v1';
Backendless.initApp(APPLICATION_ID, SECRET_KEY, VERSION);
Backendless.UserService.login(_email, _password, false, new Backendless.Async((rst) => {
// success code goes here
}, (e: any) => {
// Here I would like to receive an appropriate message instead of 'unknown message occured'
}));
Shouldn’t the backend return a message like “Wrong email/password, try again” or something?? 'Unknown error occured" does not say match, it could be anything. Or maybe there is something i’m not doing…
Hi Seya,
actually, backend does return an appropriate message in case of wrong email/password or secret key/appId. For example, in case of wrong user email/pass it should return you an Object {code: 3003, message: “Invalid login or password”, statusCode: 401} and in case of wrong app credentials message: “Version is disabled or provided wrong application info (application id or secret key)”.
Your error means that something goes wrong in another place. Could you please try again to do this request and if the problem is still occurs, provide me your App Id and Secret Key to test it with your app (or you can send it to support@backendless.com instead).
Also, what version of JS SDK do you use now?
Thanks for the quick answer, actually i am impressed by the response time.
I have tried again the application, still same error. I am sending you the app Id and the secret key
AppID: B4FD9F27-C78A-2D9C-FFE7-27671468E300
sec. Key: E797AB1A-E27D-A312-FF8F-149F6DE84C00
It looks like your backendless.js can not connect to the server. Please, check the Backendless.serverURL value - it should be “https://api.backendless.com”. And make sure that you don’t overwrite it.
My backendless.js can connect to the server because whenever I supply the right credentials every thing works fine and my app connects to the server. But when I supply wrong credentials then I receive this “error unknown occured” error. My problem is to receive the right error message.
And I just verified through debugging that the url is indeed “https://api.backendless.com”
Thanks for the support. I have been away from the office. Next week as soon as i am back to the office, I will run the sample and I will let you know how it went. Once again thanks for the continuous support
I have tried the sample you sent me. It is working. Back to my project for some reason, it looks like it is working now. The only thing I did was to regenerate a new secret key for my javascript client. (I cannot not figure out what was wrong…maybe some conflicts with other libraries as I have made a small cleanup over the weekend and have removed a couple of unused libraries…)
Any way thank you for your support, it was helpful.