Browse Source

Commit 7-4: Show a loading screen while waiting to login.

- login is too fast to see it in local dev conditions.
Frederic G. MARAND 9 years ago
parent
commit
6b2f61adf0
1 changed files with 7 additions and 1 deletions
  1. 7 1
      lib/router.js

+ 7 - 1
lib/router.js

@@ -41,7 +41,13 @@ Router.onBeforeAction('dataNotFound', {
 
 var requireLogin = function () {
   if (!Meteor.user()) {
-    this.render('accessDenied');
+    if (Meteor.loggingIn()) {
+      // Défini dans Router.configure().
+      this.render(this.loadingTemplate)
+    }
+    else {
+      this.render('accessDenied');
+    }
   }
   else {
     this.next();