mirror of
https://github.com/wekan/wekan.git
synced 2025-12-18 00:10:13 +01:00
Improves UI for ldap error messages
This commit is contained in:
parent
d7529bf6b5
commit
1712368f6a
3 changed files with 33 additions and 14 deletions
|
|
@ -121,20 +121,35 @@ function authentication(instance, email, password) {
|
||||||
return this.stop();
|
return this.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
const authenticationMethod = user ?
|
const authenticationMethod = user
|
||||||
user.authenticationMethod :
|
? user.authenticationMethod
|
||||||
instance.data.defaultAuthenticationMethod.get();
|
: instance.data.defaultAuthenticationMethod.get();
|
||||||
|
|
||||||
// Authentication with LDAP
|
switch (authenticationMethod) {
|
||||||
if (authenticationMethod === 'ldap') {
|
case 'ldap':
|
||||||
// Use the ldap connection package
|
// Use the ldap connection package
|
||||||
Meteor.loginWithLDAP(email, password, function(error) {
|
Meteor.loginWithLDAP(email, password, function(error) {
|
||||||
if (!error) {
|
if (!error) return FlowRouter.go('/');
|
||||||
return FlowRouter.go('/');
|
displayError('error-ldap-login');
|
||||||
}
|
});
|
||||||
return error;
|
break;
|
||||||
});
|
|
||||||
|
default:
|
||||||
|
displayError('error-undefined');
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.stop();
|
return this.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function displayError(code) {
|
||||||
|
const translated = TAPi18n.__(code);
|
||||||
|
|
||||||
|
if (translated === code) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!$('.at-error').length) {
|
||||||
|
$('.at-pwd-form').before('<div class="at-error"><p></p></div>');
|
||||||
|
}
|
||||||
|
$('.at-error p').text(translated);
|
||||||
|
}
|
||||||
|
|
@ -620,5 +620,7 @@
|
||||||
"layout": "Layout",
|
"layout": "Layout",
|
||||||
"hide-logo": "Hide Logo",
|
"hide-logo": "Hide Logo",
|
||||||
"add-custom-html-after-body-start": "Add Custom HTML after <body> start",
|
"add-custom-html-after-body-start": "Add Custom HTML after <body> start",
|
||||||
"add-custom-html-before-body-end": "Add Custom HTML before </body> end"
|
"add-custom-html-before-body-end": "Add Custom HTML before </body> end",
|
||||||
|
"error-undefined": "Something went wrong",
|
||||||
|
"error-ldap-login": "An error occurred while trying to login"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -619,5 +619,7 @@
|
||||||
"layout": "Interface",
|
"layout": "Interface",
|
||||||
"hide-logo": "Cacher le logo",
|
"hide-logo": "Cacher le logo",
|
||||||
"add-custom-html-after-body-start": "Add Custom HTML after <body> start",
|
"add-custom-html-after-body-start": "Add Custom HTML after <body> start",
|
||||||
"add-custom-html-before-body-end": "Add Custom HTML before </body> end"
|
"add-custom-html-before-body-end": "Add Custom HTML before </body> end",
|
||||||
|
"error-undefined": "Une erreur inconnue s'est produite",
|
||||||
|
"error-ldap-login": "Une erreur s'est produite lors de la tentative de connexion"
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue