diff options
| author | Alexander Filippov <a.filippov@yadro.com> | 2018-03-20 10:42:26 +0300 |
|---|---|---|
| committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2018-03-27 12:10:56 +0000 |
| commit | 0e480f5591bbd87c6c2db97308d97f6bfdba39f5 (patch) | |
| tree | ff9598cca696622658796bbd7eb594a9135bae94 /app/login/controllers/login-controller.js | |
| parent | 74b05409417c71855edb2692b429465507ba0a64 (diff) | |
| download | phosphor-webui-0e480f5591bbd87c6c2db97308d97f6bfdba39f5.tar.gz phosphor-webui-0e480f5591bbd87c6c2db97308d97f6bfdba39f5.zip | |
Show error message received from server side
When an error occurs during authorization, display the error message
received from server side instead hardcoded message.
Partially resolves openbmc/openbmc#2974
Resolves openbmc/openbmc#3024
Tested: Enter invalid username or password and verify error message
Change-Id: I91ca29d5a69e12e12ce490ce3206173de7d41f09
Signed-off-by: Alexander Filippov <a.filippov@yadro.com>
Diffstat (limited to 'app/login/controllers/login-controller.js')
| -rw-r--r-- | app/login/controllers/login-controller.js | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/app/login/controllers/login-controller.js b/app/login/controllers/login-controller.js index c2ed383..1f87871 100644 --- a/app/login/controllers/login-controller.js +++ b/app/login/controllers/login-controller.js @@ -30,7 +30,7 @@ window.angular && (function (angular) { }; $scope.login = function(host, username, password){ $scope.error = false; - $scope.server_unreachable = false; + $scope.description = false; if(!username || username == "" || !password || password == "" || @@ -39,15 +39,14 @@ window.angular && (function (angular) { return false; }else{ $scope.dataService.setHost(host); - userModel.login(username, password, function(status, unreachable){ + userModel.login(username, password, function(status, description){ if(status){ $scope.$emit('user-logged-in',{}); $window.location.hash = '#/overview/server'; }else{ - if(unreachable){ - $scope.server_unreachable = true; - }else{ - $scope.error = true; + $scope.error = true; + if(description){ + $scope.description = description; } }; }); |

