diff options
Diffstat (limited to 'install/ui/src/freeipa/Application_controller.js')
-rw-r--r-- | install/ui/src/freeipa/Application_controller.js | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/install/ui/src/freeipa/Application_controller.js b/install/ui/src/freeipa/Application_controller.js index 7f62159a0..4c1007b7b 100644 --- a/install/ui/src/freeipa/Application_controller.js +++ b/install/ui/src/freeipa/Application_controller.js @@ -76,6 +76,7 @@ define([ on(this.router, 'facet-show', lang.hitch(this, this.on_facet_show)); on(this.router, 'facet-change', lang.hitch(this, this.on_facet_change)); on(this.router, 'facet-change-canceled', lang.hitch(this, this.on_facet_canceled)); + on(this.router, 'error', lang.hitch(this, this.on_router_error)); topic.subscribe('phase-error', lang.hitch(this, this.on_phase_error)); this.app_widget.render(); @@ -126,16 +127,20 @@ define([ // choose default facet if not defined by route if (!this.current_facet) { - if (IPA.is_selfservice) { - this.on_profile(); - } else { - this.router.navigate_to_entity_facet('user', 'search'); - } + this.navigate_to_default(); } return this.run_time.promise; }, + navigate_to_default: function() { + if (IPA.is_selfservice) { + this.on_profile(); + } else { + this.router.navigate_to_entity_facet('user', 'search'); + } + }, + start_logout: function() { IPA.logout(); }, @@ -276,6 +281,13 @@ define([ } }, + on_router_error: function(error) { + + if (error.type === 'route') { + this.navigate_to_default(); + } + }, + /** * Tries to find menu item with assigned facet and navigate to it. */ |