Skip to content

Commit

Permalink
Removed LoginCtrl from framework
Browse files Browse the repository at this point in the history
  • Loading branch information
Hesyar Uzuner committed Apr 21, 2017
1 parent ab62a74 commit 12a3111
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 97 deletions.
49 changes: 0 additions & 49 deletions dist/js/SmlAppl.WebApps.NgFramework.js
Original file line number Diff line number Diff line change
Expand Up @@ -381,55 +381,6 @@ angular.module('smlAppl.webApps.framework').run(['$templateCache', function($tem

})();

/* #### File: ./src/Scripts/app/Controllers/LoginCtrl.js */
/*
* When data.redirectState is defined on the state, this state will be used to redirect.
* Otherwise a redirect to home will take place.
*/

(function () {
"use strict";

angular.module("smlAppl.webApps.framework.controllers")
.controller("LoginCtrl", [
"$scope", "$state", "Authentication", "$rootScope", "$location",
function($scope, $state, Authentication, $rootScope, $location) {
$scope.loginData = {
userName: "",
password: ""
};

$scope.errMessage = "";

var destPath = "";
if (localStorage.destinationPath && localStorage.destinationPath != "") {
// Prepare redirection to the previously attempted url
destPath = localStorage.destinationPath;
localStorage.destinationPath = "";
}


$scope.login = function () {

Authentication.login($scope.loginData).then(function(response) {
// login successful
if (destPath && destPath != "") {
// Redirect to the previously attempted url
$location.url(destPath);
} else {
// no redirect defined -> go to home
$state.go("home");
}
},
function(err) {
$scope.errMessage = err.error_description;
});
};
}
]);

})();

/* #### File: ./src/Scripts/app/Controllers/MsgBoxCtrl.js */
/*
The modal provides the params content and data.
Expand Down
Loading

0 comments on commit 12a3111

Please sign in to comment.