Преглед на файлове

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 години
родител
ревизия
6b2f61adf0
променени са 1 файла, в които са добавени 7 реда и са изтрити 1 реда
  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();