Skip to content

Commit

Permalink
general cleanup of indentations, new lines at the end of the file and…
Browse files Browse the repository at this point in the history
… extra commas
  • Loading branch information
lirantal committed Jul 8, 2014
1 parent ffcd139 commit c7d41f2
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 42 deletions.
2 changes: 1 addition & 1 deletion packages/articles/public/articles.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
'use strict';

angular.module('mean.articles', []);
angular.module('mean.articles', []);
80 changes: 40 additions & 40 deletions packages/users/public/controllers/meanUser.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,25 @@ angular.module('mean.users')
email: $scope.user.email,
password: $scope.user.password
})
.success(function(response) {
// authentication OK
$scope.loginError = 0;
$rootScope.user = response.user;
$rootScope.$emit('loggedin');
if (response.redirect) {
if (window.location.href === response.redirect) {
//This is so an admin user will get full admin page
window.location.reload();
} else {
window.location = response.redirect;
}
.success(function(response) {
// authentication OK
$scope.loginError = 0;
$rootScope.user = response.user;
$rootScope.$emit('loggedin');
if (response.redirect) {
if (window.location.href === response.redirect) {
//This is so an admin user will get full admin page
window.location.reload();
} else {
$location.url('/');
window.location = response.redirect;
}
})
.error(function() {
$scope.loginerror = 'Authentication failed.';
});
} else {
$location.url('/');
}
})
.error(function() {
$scope.loginerror = 'Authentication failed.';
});
};
}
])
Expand All @@ -47,22 +47,22 @@ angular.module('mean.users')
username: $scope.user.username,
name: $scope.user.name
})
.success(function() {
// authentication OK
$scope.registerError = 0;
$rootScope.user = $scope.user;
$rootScope.$emit('loggedin');
$location.url('/');
})
.error(function(error) {
// Error: authentication failed
if (error === 'Username already taken') {
$scope.usernameError = error;
} else if (error === 'Email already taken'){
$scope.emailError = error;
}
else $scope.registerError = error;
});
.success(function() {
// authentication OK
$scope.registerError = 0;
$rootScope.user = $scope.user;
$rootScope.$emit('loggedin');
$location.url('/');
})
.error(function(error) {
// Error: authentication failed
if (error === 'Username already taken') {
$scope.usernameError = error;
} else if (error === 'Email already taken'){
$scope.emailError = error;
}
else $scope.registerError = error;
});
};
}
])
Expand All @@ -71,14 +71,14 @@ angular.module('mean.users')
$scope.user = {};
$scope.forgotpassword = function() {
$http.post('/forgot-password', {
text: $scope.text,
text: $scope.text
})
.success(function(response) {
$scope.response = response;
})
.success(function(response) {
$scope.response = response;
})
.error(function(error) {
$scope.response = error;
});
.error(function(error) {
$scope.response = error;
});
};
}
])
Expand Down
2 changes: 1 addition & 1 deletion packages/users/public/users.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
'use strict';

angular.module('mean.users', []);
angular.module('mean.users', []);

0 comments on commit c7d41f2

Please sign in to comment.