How to handle cloudboost errors in Ionic2? -


the error when user fails log in "error: request failed status code 401". error logged here:

static login(username : string, password : string){     return new promise(resolve =>{         let user = new cb.clouduser();         user.set('username', username);         user.set('password', password);         user.login({           success: function(user) {             console.log("user");             resolve();           },           error: function(error) {             console.log(error);             resolve(error);           }         });     }); } 

but need error says went wrong e.g. "invalid username" or "user not authenticated".

how these?

error: request failed status code 401 

this error means login request made server not authenticated/ not authorized make login request. can mean cb instance not initialized. please check appid , master/client key using initialize cb instance.


Comments

Popular posts from this blog

html - How to set bootstrap input responsive width? -

javascript - Highchart x and y axes data from json -

javascript - Get js console.log as python variable in QWebView pyqt -