소스 검색

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();