Logout
components.Authentication.setUnAuthListener(() => { let router = element.red.Navigation.instance() .router('main-router'); if(null == router || '/' == router.current()) { console.log('router is null'); return; } //TODO: clean everything from context router.navigate('/'); }); this.set('currentMainPath', ''); this.set('currentMainPath', event.$current.getPath().split('/') .pop()); this.referenceBinder('main-menu').link((element) => { element.getContext().set('mainroutes', event.$element.configuration().routes[1].routes); }); return new Promise((resolve) => { components.Authentication.setToken(null); resolve(); }); this.doLogout().then(() => { element.red.Navigation.instance().router('main-router').navigate('/'); });