From 9a5d0a2216845c24ab54d10475452b06b16c4c4e Mon Sep 17 00:00:00 2001 From: Nabil Adouani Date: Tue, 30 Jun 2020 17:39:23 +0200 Subject: [PATCH] #1420 Display error message returned by the /api/ssoLogin api. --- frontend/app/scripts/controllers/AuthenticationCtrl.js | 6 ++++++ frontend/app/views/login.html | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/frontend/app/scripts/controllers/AuthenticationCtrl.js b/frontend/app/scripts/controllers/AuthenticationCtrl.js index 22e675e7c6..7b9685e601 100644 --- a/frontend/app/scripts/controllers/AuthenticationCtrl.js +++ b/frontend/app/scripts/controllers/AuthenticationCtrl.js @@ -20,6 +20,7 @@ $scope.params.username = $scope.params.username.toLowerCase(); AuthenticationSrv.login($scope.params.username, $scope.params.password, $scope.params.mfaCode) .then(function() { + $location.search('error', null); $state.go('app.index'); }) .catch(function(err) { @@ -32,5 +33,10 @@ } }); }; + + var error = UtilsSrv.extractQueryParam('error', UrlParser('query', $location.absUrl())); + if(!_.isEmpty(error)) { + $scope.ssoError = window.decodeURIComponent(error).replace(/\+/gi, ' ', ''); + } }); })(); diff --git a/frontend/app/views/login.html b/frontend/app/views/login.html index f31da6bdf3..a5219c77b2 100644 --- a/frontend/app/views/login.html +++ b/frontend/app/views/login.html @@ -35,6 +35,11 @@
Sign In with SSO
+ +
+ {{ssoError}} +
+