I am attempting to incorporate the login/signup example for Bootstrap/AngularJS into my app, when I test the database service it works fine yet when I copy over the code from the example to my app and change the service referenced to my service it results in a (400) bad request for both login and sign up.
I have copied everything over from the example exactly as it was shown, so the required variables, the inputs, buttons and the code for both login() and register()
I have been tearing my hair out over this one for the last few hours and I cannot seem to find out what the issue is.
Login code
//Login();
var requestData = {};
requestData.params = Apperyio.EntityAPI('data_login_service.request.query', undefined, true);
var username_scope = $scope["username"];
var password_scope = $scope["password"];
requestData.params["username"] = username_scope;
requestData.params["password"] = password_scope;
Apperyio.get("data_login_service")(requestData).then(
Code: Select all
function(success){ //Store sessionToken to Settings
Apperyio.configAdd('Settings.sessionToken', success.data.sessionToken);
Code: Select all
Apperyio.navigateTo('Featured');
}, function(error){
alert('Error when signing in');
Code: Select all
}); Register code
//register();
var requestData = {};
requestData.data = Apperyio.EntityAPI('data_signup_service.request.body', undefined, true);
var username_scope = $scope["register_username"];
var password_scope = $scope["register_password"];
requestData.data.username = username_scope;
requestData.data.password = password_scope;
Apperyio.get("data_signup_service")(requestData).then(
Code: Select all
function(success){
//Store sessionToken to Settings
Apperyio.configAdd('Settings.sessionToken', success.data.sessionToken);
Apperyio.navigateTo('Featured');
},
function(error){
alert('Error when registering');
}); My app is shared with support, it is called WeLove Kent