Files
wekan/server/lib/restAuthenticationMethod.js
Lauri Ojansivu b294ecfb01 Authenticate LDAP users through the REST login route
Route existing and first-time LDAP username credentials through Meteor server login handlers instead of requiring a local bcrypt password. Preserve uniform failures, throttling, two-factor checks, REST token creation, and local-password behavior.

Thanks to mariogalan, ViViDboarder, mgiacomoli, HaKePlan and xet7 !

Fixes #3707,
2026-08-25 19:29:41 +03:00

17 lines
413 B
JavaScript

function useLdapForRestLogin({ user, ldapEnabled, usernameProvided }) {
if (!ldapEnabled || !usernameProvided) return false;
if (!user) return true;
return user.authenticationMethod === 'ldap';
}
function ldapRestLoginRequest(username, password) {
return {
ldap: true,
username,
ldapPass: password,
ldapOptions: {},
};
}
module.exports = { useLdapForRestLogin, ldapRestLoginRequest };