Skip to content

Commit

Permalink
#1420 Display error message returned by the /api/ssoLogin api.
Browse files Browse the repository at this point in the history
  • Loading branch information
nadouani committed Jun 30, 2020
1 parent f9d4073 commit 9a5d0a2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions frontend/app/scripts/controllers/AuthenticationCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -32,5 +33,10 @@
}
});
};

var error = UtilsSrv.extractQueryParam('error', UrlParser('query', $location.absUrl()));
if(!_.isEmpty(error)) {
$scope.ssoError = window.decodeURIComponent(error).replace(/\+/gi, ' ', '');
}
});
})();
5 changes: 5 additions & 0 deletions frontend/app/views/#.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@
<div class="mv-xs">
<a class="btn btn-success btn-m btn-block" href="./api/ssoLogin"># with SSO</a>
</div>

<div class="text-danger wrap" ng-if="ssoError">
{{ssoError}}
</div>

</div>
</form>
</div>
Expand Down

0 comments on commit 9a5d0a2

Please # to comment.