summaryrefslogtreecommitdiffstats
path: root/client/components/main/layouts.js
diff options
context:
space:
mode:
authorguillaume <guillaume.cassou@orange.fr>2019-04-24 12:28:11 +0200
committerguillaume <guillaume.cassou@orange.fr>2019-04-24 12:28:11 +0200
commit8b3601248deb7f45d5bb5cb2d35d9a7ebaac1ab1 (patch)
treea9e75f5c24133f82e4bbbcc597744e16cd8a9620 /client/components/main/layouts.js
parent642002030919ad2db2121d9f5c3754faf9a6b965 (diff)
downloadwekan-8b3601248deb7f45d5bb5cb2d35d9a7ebaac1ab1.tar.gz
wekan-8b3601248deb7f45d5bb5cb2d35d9a7ebaac1ab1.tar.bz2
wekan-8b3601248deb7f45d5bb5cb2d35d9a7ebaac1ab1.zip
Loading authentication page
Diffstat (limited to 'client/components/main/layouts.js')
-rw-r--r--client/components/main/layouts.js27
1 files changed, 19 insertions, 8 deletions
diff --git a/client/components/main/layouts.js b/client/components/main/layouts.js
index 6f7c914a..9d2e7ae2 100644
--- a/client/components/main/layouts.js
+++ b/client/components/main/layouts.js
@@ -23,6 +23,7 @@ const validator = {
Template.userFormsLayout.onCreated(function() {
const instance = this;
instance.currentSetting = new ReactiveVar();
+ instance.isLoading = new ReactiveVar(false);
Meteor.subscribe('setting', {
onReady() {
@@ -47,6 +48,10 @@ Template.userFormsLayout.helpers({
return Template.instance().currentSetting.get();
},
+ isLoading() {
+ return Template.instance().isLoading.get();
+ },
+
afterBodyStart() {
return currentSetting.customHTMLafterBodyStart;
},
@@ -89,7 +94,11 @@ Template.userFormsLayout.events({
},
'click #at-btn'(event, instance) {
if (FlowRouter.getRouteName() === 'atSignIn') {
- authentication(event, instance);
+ instance.isLoading.set(true);
+ authentication(event, instance)
+ .then(() => {
+ instance.isLoading.set(false);
+ });
}
},
});
@@ -116,19 +125,21 @@ async function authentication(event, instance) {
switch (result) {
case 'ldap':
- Meteor.loginWithLDAP(match, password, function() {
- FlowRouter.go('/');
+ return new Promise((resolve) => {
+ Meteor.loginWithLDAP(match, password, function() {
+ resolve(FlowRouter.go('/'));
+ });
});
- break;
case 'cas':
- Meteor.loginWithCas(function() {
- FlowRouter.go('/');
+ return new Promise((resolve) => {
+ Meteor.loginWithCas(match, password, function() {
+ resolve(FlowRouter.go('/'));
+ });
});
- break;
default:
- break;
+ return;
}
}