LILiK login and user managment web interface
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
799 B

  1. 'use strict';
  2. angular.module('Authentication')
  3. .controller('LoginController',
  4. ['$scope', '$rootScope', '$location', 'AuthenticationService',
  5. function ($scope, $rootScope, $location, AuthenticationService) {
  6. // reset login status
  7. AuthenticationService.ClearCredentials();
  8. $scope.login = function () {
  9. $scope.dataLoading = true;
  10. AuthenticationService.Login($scope.username, $scope.password, function (response) {
  11. if (response.success) {
  12. $location.path('/users/'+$scope.username);
  13. } else {
  14. console.log(response);
  15. $scope.error = response.message;
  16. $scope.dataLoading = false;
  17. }
  18. });
  19. };
  20. }]);