mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 23:40:13 +01:00
Loading authentication page
This commit is contained in:
parent
6420020309
commit
8b3601248d
5 changed files with 150 additions and 26 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue