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

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -