diff --git a/app/ctrls/ms-ctrls.js b/app/ctrls/ms-ctrls.js index 34d04017..73b03905 100755 --- a/app/ctrls/ms-ctrls.js +++ b/app/ctrls/ms-ctrls.js @@ -18,6 +18,7 @@ function($scope, $state, $stateParams, Auth, $window) { // sets method and changes url param $scope.switchMethod = function(method) { $scope.method = Auth.loginMethod(method); + $scope.inValid = false; //$state.go('main.home', {login: method}); } diff --git a/app/services/auth.js b/app/services/auth.js index 45b850f0..7c5ab914 100644 --- a/app/services/auth.js +++ b/app/services/auth.js @@ -88,10 +88,14 @@ function($state, $http, config, $window) { this.logout = function() { $window.localStorage.removeItem('auth'); - $state.transitionTo('main.home', {}, { reload: true, inherit: true, notify: false }) - .then(function() { - $window.location.reload(); - }); + + var to_url = window.location.protocol + '//' + window.location.host; + if ($state.current.name === 'main.home') { + $window.location.reload(); + } else { + to_url = to_url + '/genomes/Plants'; + $window.location.replace(to_url); + } } this.isAuthenticated = function() { diff --git a/app/services/dialogs.js b/app/services/dialogs.js index 4416e949..4fbc2ab3 100644 --- a/app/services/dialogs.js +++ b/app/services/dialogs.js @@ -789,7 +789,6 @@ function($rootScope, $dialog, $window, $timeout, Auth, $stateParams) { $s.method = Auth.loginMethod(method); $stateParams.login = method; $s.inValid = false; - $s.creds = {}; } $s.ok = function(){ diff --git a/app/views/dialogs/auth.html b/app/views/dialogs/auth.html index 89529077..2bf35dcb 100644 --- a/app/views/dialogs/auth.html +++ b/app/views/dialogs/auth.html @@ -5,7 +5,7 @@