NIFI-655:

- Ensuring the logout link is rendered when appropriate.
This commit is contained in:
Matt Gilman 2015-11-13 16:35:29 -05:00
parent 749f4e9be1
commit c659485ee4
1 changed files with 10 additions and 7 deletions

View File

@ -64,9 +64,10 @@ $(document).ready(function () {
// initialize the tooltips
$('img.setting-icon').qtip(nf.Common.config.tooltipConfig);
// shows the logout link in the message-pane when appropriate
if (nf.Storage.getItem('jwt')) {
// shows the logout link in the message-pane when appropriate and schedule token refresh
if (nf.Storage.getItem('jwt') !== null) {
$('#user-logout-container').show();
nf.Common.scheduleTokenRefresh();
}
// handle logout
@ -74,11 +75,6 @@ $(document).ready(function () {
nf.Storage.removeItem('jwt');
window.location = '/nifi/login';
});
// schedule token refresh when a token is present
if (nf.Storage.getItem('jwt') !== null) {
nf.Common.scheduleTokenRefresh();
}
});
// Define a common utility class used across the entire application.
@ -412,6 +408,13 @@ nf.Common = (function () {
if ($('#splash').is(':visible')) {
nf.Canvas.hideSplash();
}
// update the log out link accordingly
if (nf.Storage.getItem('jwt') === null) {
$('#user-logout-container').hide();
} else {
$('#user-logout-container').show();
}
// hide the context menu
nf.ContextMenu.hide();