aboutsummaryrefslogtreecommitdiffstats
path: root/www/js/views/home.js
diff options
context:
space:
mode:
authorDave Arter <davea@mysociety.org>2017-06-13 16:42:52 +0100
committerDave Arter <davea@mysociety.org>2018-04-08 14:44:31 +0100
commit64cc9c6c2c1b5ada438fd6e874e812739c259b1a (patch)
treeaa4b271c3bdd6a59985949f8882db936f3e4309c /www/js/views/home.js
parentc3214d95c633d63a93c67bba4879396bee465a99 (diff)
Enforce LOGIN_REQUIRED setting
If LOGIN_REQUIRED is true, the app won't let you do anything until you've logged in.
Diffstat (limited to 'www/js/views/home.js')
-rw-r--r--www/js/views/home.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/www/js/views/home.js b/www/js/views/home.js
index 998af1c..05ee2f7 100644
--- a/www/js/views/home.js
+++ b/www/js/views/home.js
@@ -24,8 +24,11 @@
afterDisplay: function() {
$('#load-screen').hide();
+
if ( FMS.isOffline ) {
this.navigate( 'offline' );
+ } else if ( !FMS.isLoggedIn && CONFIG.LOGIN_REQUIRED ) {
+ this.navigate( 'login' );
} else if ( FMS.currentDraft && (
FMS.currentDraft.get('title') || FMS.currentDraft.get('lat') ||
FMS.currentDraft.get('details') || FMS.currentDraft.get('file') )