Added extra nesting .data and rename callback to be response not data

This commit is contained in:
Kegan Dougal 2014-08-14 15:43:16 +01:00
parent db3e1d73c6
commit 24bd133d9d
2 changed files with 31 additions and 31 deletions

View file

@ -68,7 +68,7 @@ angular.module('LoginController', ['matrixService'])
// try to login
matrixService.login($scope.account.user_id, $scope.account.password).then(
function(response) {
if ("access_token" in response) {
if ("access_token" in response.data) {
$scope.feedback = "Login successful.";
matrixService.setConfig({
homeserver: $scope.account.homeserver,
@ -79,7 +79,7 @@ angular.module('LoginController', ['matrixService'])
$location.path("rooms");
}
else {
$scope.feedback = "Failed to login: " + JSON.stringify(response);
$scope.feedback = "Failed to login: " + JSON.stringify(response.data);
}
},
function(error) {