I am experiencing very strange issue when building and running ionic app. I am calling Login API from server and it work very well in browser, when run as
$ionic serve --lab
But when app is installed in Android, it gives 403 error, and does not give any other information about error code, probably, i am not sure how to get browser console log in android hybrid app.
I have login function as follows
login: function(user) {
var deferred = $q.defer();
$http.post(SERVER_URL + '/auth/login', {
username: user.username,
password: user.password
}).success(function(response, status, headers, config) {
if (response.data && response.data[0]) {
Auth.setToken(response.data[0].token);
Auth.setUserId(response.data[0].id);
deferred.resolve(response);
} else {
deferred.reject(response);
}
}).error(function(response, status, headers, config) {
deferred.reject(response);
});
return deferred.promise;
}
However, all the get request works properly.