浏览代码

Fix lints

guillaume 6 年之前
父节点
当前提交
ec453b89b8
共有 1 个文件被更改,包括 11 次插入6 次删除
  1. 11 6
      client/components/main/layouts.js

+ 11 - 6
client/components/main/layouts.js

@@ -114,16 +114,21 @@ async function authentication(event, instance) {
   event.preventDefault();
   event.preventDefault();
   event.stopImmediatePropagation();
   event.stopImmediatePropagation();
 
 
-  if (result === 'ldap') {
-    return Meteor.loginWithLDAP(match, password, function() {
+  switch (result) {
+  case 'ldap':
+    Meteor.loginWithLDAP(match, password, function() {
       FlowRouter.go('/');
       FlowRouter.go('/');
     });
     });
-  }
+    break;
 
 
-  if (result === 'cas') {
-    return Meteor.loginWithCas(function() {
+  case 'cas':
+    Meteor.loginWithCas(function() {
       FlowRouter.go('/');
       FlowRouter.go('/');
     });
     });
+    break;
+
+  default:
+    break;
   }
   }
 }
 }
 
 
@@ -135,7 +140,7 @@ function getAuthenticationMethod({displayAuthenticationMethod, defaultAuthentica
 }
 }
 
 
 function getUserAuthenticationMethod(defaultAuthenticationMethod, match) {
 function getUserAuthenticationMethod(defaultAuthenticationMethod, match) {
-  return new Promise((resolve, reject) => {
+  return new Promise((resolve) => {
     try {
     try {
       Meteor.subscribe('user-authenticationMethod', match, {
       Meteor.subscribe('user-authenticationMethod', match, {
         onReady() {
         onReady() {