mirror of
https://github.com/wekan/wekan.git
synced 2025-12-20 09:20:12 +01:00
- Revert Improve authentication to [fix Login failure](https://github.com/wekan/wekan/issues/2004).
Thanks to xet7 ! Closes #2004
This commit is contained in:
parent
7a75d82114
commit
aa691b0af1
13 changed files with 89 additions and 137 deletions
34
client/components/settings/connectionMethod.js
Normal file
34
client/components/settings/connectionMethod.js
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
Template.connectionMethod.onCreated(function() {
|
||||
this.authenticationMethods = new ReactiveVar([]);
|
||||
|
||||
Meteor.call('getAuthenticationsEnabled', (_, result) => {
|
||||
if (result) {
|
||||
// TODO : add a management of different languages
|
||||
// (ex {value: ldap, text: TAPi18n.__('ldap', {}, T9n.getLanguage() || 'en')})
|
||||
this.authenticationMethods.set([
|
||||
{value: 'password'},
|
||||
// Gets only the authentication methods availables
|
||||
...Object.entries(result).filter((e) => e[1]).map((e) => ({value: e[0]})),
|
||||
]);
|
||||
}
|
||||
|
||||
// If only the default authentication available, hides the select boxe
|
||||
const content = $('.at-form-authentication');
|
||||
if (!(this.authenticationMethods.get().length > 1)) {
|
||||
content.hide();
|
||||
} else {
|
||||
content.show();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Template.connectionMethod.onRendered(() => {
|
||||
// Moves the select boxe in the first place of the at-pwd-form div
|
||||
$('.at-form-authentication').detach().prependTo('.at-pwd-form');
|
||||
});
|
||||
|
||||
Template.connectionMethod.helpers({
|
||||
authentications() {
|
||||
return Template.instance().authenticationMethods.get();
|
||||
},
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue