mirror of
https://github.com/wekan/wekan.git
synced 2025-12-20 17:30:13 +01:00
Do not show OAuth2 in auth method dropdown as it has its own button
This commit is contained in:
parent
99d9291a28
commit
d93a58d892
1 changed files with 6 additions and 10 deletions
|
|
@ -3,22 +3,18 @@ Template.connectionMethod.onCreated(function() {
|
||||||
|
|
||||||
Meteor.call('getAuthenticationsEnabled', (_, result) => {
|
Meteor.call('getAuthenticationsEnabled', (_, result) => {
|
||||||
if (result) {
|
if (result) {
|
||||||
|
// Only enabled auth methods without OAuth2/OpenID which is a separate button
|
||||||
|
const tmp = Object.keys(result).filter((k) => result[k]).filter((k) => k !== 'oauth2');
|
||||||
|
|
||||||
// TODO : add a management of different languages
|
// TODO : add a management of different languages
|
||||||
// (ex {value: ldap, text: TAPi18n.__('ldap', {}, T9n.getLanguage() || 'en')})
|
// (ex {value: ldap, text: TAPi18n.__('ldap', {}, T9n.getLanguage() || 'en')})
|
||||||
this.authenticationMethods.set([
|
this.authenticationMethods.set([{ value: 'password' }].concat(tmp.map((k) => { return { value: k }; })));
|
||||||
{ 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
|
// If only the default authentication available, hides the select boxe
|
||||||
const content = $('.at-form-authentication');
|
const content = $('.at-form-authentication');
|
||||||
// OAuth method is a separate button, so ignore it in the count
|
|
||||||
const formAuthenticationMethods = this.authenticationMethods.get().filter((method) => method.value !== 'oauth2');
|
if (this.authenticationMethods.get().length > 1) {
|
||||||
if (formAuthenticationMethods.length > 1) {
|
|
||||||
content.show();
|
content.show();
|
||||||
} else {
|
} else {
|
||||||
content.hide();
|
content.hide();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue