mirror of https://github.com/apache/nifi.git
NIFI-655:
- Ensuring the logout link is rendered when appropriate.
This commit is contained in:
parent
749f4e9be1
commit
c659485ee4
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue