summaryrefslogtreecommitdiffstats
path: root/install/ui/src/freeipa/Application_controller.js
diff options
context:
space:
mode:
authorPetr Vobornik <pvoborni@redhat.com>2014-05-21 10:07:19 +0200
committerPetr Vobornik <pvoborni@redhat.com>2014-06-11 13:54:20 +0200
commit905d58a2a4bb88ed77552e37782eb274d5398ba0 (patch)
treef4a7af202b1b7c3f769aadf5430bf3b04ca5fd6d /install/ui/src/freeipa/Application_controller.js
parent4b2d20a1f95edd2982fbb1901287f2bb2194c9db (diff)
downloadfreeipa-905d58a2a4bb88ed77552e37782eb274d5398ba0.tar.gz
freeipa-905d58a2a4bb88ed77552e37782eb274d5398ba0.tar.xz
freeipa-905d58a2a4bb88ed77552e37782eb274d5398ba0.zip
webui: handle back button when unauthenticated
using browser history when unauthenticated causes transition to the original and/or preceding facets. But nothing works since all commands fail due to expired credentials in session. These changes make sure that user stays on login screen if he misses valid session credentials while he wants to switch to facet which requires authentication. https://fedorahosted.org/freeipa/ticket/4353 Reviewed-By: Endi Sukma Dewata <edewata@redhat.com>
Diffstat (limited to 'install/ui/src/freeipa/Application_controller.js')
-rw-r--r--install/ui/src/freeipa/Application_controller.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/install/ui/src/freeipa/Application_controller.js b/install/ui/src/freeipa/Application_controller.js
index f38a60dc3..7296aa4ca 100644
--- a/install/ui/src/freeipa/Application_controller.js
+++ b/install/ui/src/freeipa/Application_controller.js
@@ -27,6 +27,7 @@ define([
'dojo/topic',
'dojo/query',
'dojo/dom-class',
+ './auth',
'./json2',
'./widgets/App',
'./widgets/FacetContainer',
@@ -36,7 +37,7 @@ define([
'./navigation/Router',
'./navigation/menu_spec'
],
- function(declare, lang, array, Deferred, on, topic, query, dom_class,
+ function(declare, lang, array, Deferred, on, topic, query, dom_class, auth,
JSON, App_widget, FacetContainer, IPA, reg, Menu, Router, menu_spec) {
/**
@@ -297,6 +298,12 @@ define([
show_facet: function(facet) {
+ // prevent changing facet when authenticating
+ if (this.current_facet && this.current_facet.name === 'login' &&
+ !auth.current.authenticated && facet.requires_auth) {
+ return;
+ }
+
// choose container
var container = this.containers[facet.preferred_container];
if (!container) container = this.containers.main;
@@ -455,7 +462,6 @@ define([
var login_facet = reg.facet.get('login');
on.once(login_facet, "logged_in", function() {
-
if (facet) {
self.show_facet(facet);
}