Ensures that in-active users are not allowed to login. (#618)

This commit is contained in:
kevgliss
2016-12-19 22:58:57 -08:00
committed by GitHub
parent c7fdb2acd7
commit 2f5f82d797
4 changed files with 30 additions and 4 deletions

View File

@ -105,6 +105,15 @@
RestangularConfigurer.setBaseUrl('http://localhost:8000/api/1');
RestangularConfigurer.setDefaultHttpFields({withCredentials: true});
// handle situation where our token has become invalid.
RestangularConfigurer.setErrorInterceptor(function (response) {
if (response.status === 403) {
$auth.logout();
$location.path('/login');
return false;
}
});
RestangularConfigurer.addResponseInterceptor(function (data, operation) {
var extractedData;

View File

@ -27,7 +27,7 @@
<td data-title="'Active'" sortable="'active'">
<i class="glyphicon glyphicon-ok" ng-show="certificate.san == 'true'"></i>
<i class="glyphicon glyphicon-remove" ng-show="certificate.san == 'false'"></i>
<i ng-show="user.active" class="glyphicon glyphicon-ok"></i><i ng-show="!user.active" class="glyphicon gplyphinco-remove"></i>
<i ng-show="user.active" class="glyphicon glyphicon-ok"></i><i ng-show="!user.active" class="glyphicon glyphicon-remove"></i>
</td>
<td data-title="''">
<div class="btn-group-vertical pull-right">