updated $http call to angular 1.4 implementation

This commit is contained in:
Jared Tabor 2015-10-06 17:42:17 -04:00
parent 61b0e80a5f
commit 116b0849a7

View File

@ -186,17 +186,17 @@ export default ['$log', '$cookieStore', '$compile', '$window', '$rootScope', '$l
Authorization.retrieveToken(username, password)
.then(function (data) {
$('#login-modal').modal('hide');
Authorization.setToken(data.token, data.expires);
Authorization.setToken(data.data.token, data.data.expires);
$rootScope.sessionTimer = Timer.init();
scope.$emit('AuthorizationGetUser');
},
function (data) {
var key;
Wait('stop');
if (data.non_field_errors && data.non_field_errors.length === 0) {
if (data.data.non_field_errors && data.data.non_field_errors.length === 0) {
// show field specific errors returned by the API
for (key in data) {
scope[key + 'Error'] = data[key][0];
for (key in data.data) {
scope[key + 'Error'] = data.data[key][0];
}
} else {
scope.reset();