Skip to content
Snippets Groups Projects
Commit 8c95363d authored by Mirco Nasuti's avatar Mirco Nasuti
Browse files

removed a hard coded URL

parent 32512a30
No related branches found
No related tags found
No related merge requests found
/** /**
* Created by Michael DESIGAUD on 10/09/2015. * Created by Michael DESIGAUD on 10/09/2015.
*/ */
angular.module('chuvApp.login').controller('LoginController', ['$scope', '$translatePartialLoader', '$translate', '$rootScope', '$state', 'User', angular.module('chuvApp.login').controller('LoginController', ['$scope', '$translatePartialLoader', '$translate', '$rootScope', '$state', 'User', 'backendUrl',
function ($scope, $translatePartialLoader, $translate, $rootScope, $state, User) { function ($scope, $translatePartialLoader, $translate, $rootScope, $state, User, backendUrl) {
$translatePartialLoader.addPart('login'); $translatePartialLoader.addPart('login');
$translate.refresh(); $translate.refresh();
$scope.username = null; $scope.username = null;
$scope.password = null; $scope.password = null;
$scope.error = false; $scope.error = false;
$scope.login = function () { $scope.login = function () {
User.authenticate($scope.username, $scope.password) User.authenticate($scope.username, $scope.password)
.then(function(user) { .then(function(user) {
if (user !== null) { if (user !== null) {
$state.go('home'); $state.go('home');
} else { } else {
$scope.error = true; $scope.error = true;
alert("bad credentials"); alert("bad credentials");
} }
}); });
}; };
}]
); $scope.go = function () {
window.location.href = backendUrl + '/login/hbp';
};
}]
);
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<h3>&nbsp;</h3> <h3>&nbsp;</h3>
<h2>Login to HBP</h2> <h2>Login to HBP</h2>
<button type="button" onclick="location.href='http://155.105.202.24:8080/login/hbp';" class="btn-round"> <button type="button" ng-click='go()' class="btn-round">
<span> <span>
<span>{{'login.title' | translate }}</span> <span>{{'login.title' | translate }}</span>
<i class="ti ti-arrow-down"></i> <i class="ti ti-arrow-down"></i>
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment