KEYCLOAK-667 Remove client-side idle timeout from admin console - with sso idle timeout we have a server-side mechanism for this
This commit is contained in:
1 parent
3530fa6259
commit
a1b6378bef
4 files changed
+5
-41
No files matched your search
@@ -17,8 +17,6 @@
|
||||
<script src="lib/angular/angular-route.js"></script>
|
||||
<script src="lib/angular/ui-bootstrap-tpls-0.11.0.js"></script>
|
||||
|
||||
<script src="lib/jquery/jquery.idletimer.js" type="text/javascript"></script>
|
||||
<script src="lib/jquery/jquery.idletimeout.js" type="text/javascript"></script>
|
||||
<script src="lib/angular/select2.js" type="text/javascript"></script>
|
||||
<script src="lib/fileupload/angular-file-upload.min.js"></script>
|
||||
<script src="lib/filesaver/FileSaver.js"></script>
|
||||
@@ -75,28 +73,5 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$.idleTimeout('#idletimeout', '#idletimeout a', {
|
||||
idleAfter: 300,
|
||||
pollingInterval: 60,
|
||||
// keepAliveURL: authUrl + '/admin/keepalive', would need to change this path
|
||||
serverResponseEquals: '',
|
||||
failedRequests: 1,
|
||||
onTimeout: function(){
|
||||
$(this).slideUp();
|
||||
logout();
|
||||
},
|
||||
onIdle: function(){
|
||||
$(this).slideDown(); // show the warning bar
|
||||
},
|
||||
onCountdown: function( counter ){
|
||||
$(this).find("span").html( counter ); // update the counter
|
||||
},
|
||||
onResume: function(){
|
||||
$(this).slideUp(); // hide the warning bar
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -4,17 +4,9 @@ var consoleBaseUrl = window.location.href;
|
||||
consoleBaseUrl = consoleBaseUrl.substring(0, consoleBaseUrl.indexOf("/console"));
|
||||
consoleBaseUrl = consoleBaseUrl + "/console";
|
||||
var configUrl = consoleBaseUrl + "/config";
|
||||
var logoutUrl = consoleBaseUrl + "/logout";
|
||||
|
||||
var auth = {};
|
||||
var logout = function(){
|
||||
console.log('*** LOGOUT');
|
||||
window.location = logoutUrl;
|
||||
};
|
||||
|
||||
|
||||
var authUrl = window.location.href;
|
||||
authUrl = authUrl.substring(0, authUrl.indexOf('/admin/'));
|
||||
|
||||
var authUrl = window.location.href.substring(0, window.location.href.indexOf('/admin/'));
|
||||
|
||||
var module = angular.module('keycloak', [ 'keycloak.services', 'keycloak.loaders', 'ui.bootstrap', 'ui.select2', 'angularFileUpload' ]);
|
||||
var resourceRequests = 0;
|
||||
@@ -803,14 +795,13 @@ module.config(function($httpProvider) {
|
||||
|
||||
});
|
||||
|
||||
module.factory('errorInterceptor', function($q, $window, $rootScope, $location,Notifications) {
|
||||
module.factory('errorInterceptor', function($q, $window, $rootScope, $location, Notifications, Auth) {
|
||||
return function(promise) {
|
||||
return promise.then(function(response) {
|
||||
return response;
|
||||
}, function(response) {
|
||||
if (response.status == 401) {
|
||||
console.log('session timeout?');
|
||||
logout();
|
||||
Auth.authz.logout();
|
||||
} else if (response.status == 403) {
|
||||
Notifications.error("Forbidden");
|
||||
} else if (response.status == 404) {
|
||||
|
||||
-2
@@ -4,8 +4,6 @@ module.controller('GlobalCtrl', function($scope, $http, Auth, WhoAmI, Current, $
|
||||
};
|
||||
|
||||
$scope.authUrl = authUrl;
|
||||
$scope.logout = logout;
|
||||
|
||||
$scope.auth = Auth;
|
||||
|
||||
WhoAmI.get(function (data) {
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="{{authUrl}}/realms/{{auth.user.realm}}/account?referrer=security-admin-console">Manage Account</a></li>
|
||||
<li class="separator"><a href="" ng-click="logout()">Sign Out</a></li>
|
||||
<li class="separator"><a href="" ng-click="auth.authz.logout()">Sign Out</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
Reference in new issue
Block a user