UNPKG

jupyterlab-logout

Version:
24 lines (23 loc) 760 B
import { IRouter, } from '@jupyterlab/application'; import '@jupyterlab/application/style/buttons.css'; import '../style/index.css'; const logoutPluginId = 'jupyterlab-logout:plugin'; const extension = { id: logoutPluginId, autoStart: true, requires: [IRouter], activate: async (app, router) => { console.log('jupyterlab-logout extension is activated!'); // Get app commands const { commands } = app; const namespace = 'jupyterlab-topbar'; const command = namespace + ':logout'; commands.addCommand(command, { label: 'Log Out', execute: (args) => { router.navigate('/logout', { hard: true }); }, }); }, }; export default extension;