mirror of
https://github.com/ansible/awx.git
synced 2026-03-27 13:55:04 -02:30
updated $http call to angular 1.4 implementation
This commit is contained in:
@@ -186,17 +186,17 @@ export default ['$log', '$cookieStore', '$compile', '$window', '$rootScope', '$l
|
|||||||
Authorization.retrieveToken(username, password)
|
Authorization.retrieveToken(username, password)
|
||||||
.then(function (data) {
|
.then(function (data) {
|
||||||
$('#login-modal').modal('hide');
|
$('#login-modal').modal('hide');
|
||||||
Authorization.setToken(data.token, data.expires);
|
Authorization.setToken(data.data.token, data.data.expires);
|
||||||
$rootScope.sessionTimer = Timer.init();
|
$rootScope.sessionTimer = Timer.init();
|
||||||
scope.$emit('AuthorizationGetUser');
|
scope.$emit('AuthorizationGetUser');
|
||||||
},
|
},
|
||||||
function (data) {
|
function (data) {
|
||||||
var key;
|
var key;
|
||||||
Wait('stop');
|
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
|
// show field specific errors returned by the API
|
||||||
for (key in data) {
|
for (key in data.data) {
|
||||||
scope[key + 'Error'] = data[key][0];
|
scope[key + 'Error'] = data.data[key][0];
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
scope.reset();
|
scope.reset();
|
||||||
|
|||||||
Reference in New Issue
Block a user