Migrate wekan-ldap to async API for Meteor 3.0

- Replace Meteor.wrapAsync with native Promises
- Convert all sync methods to async
- Use async DB operations (findOneAsync, updateAsync)
- Bump version 0.0.2 → 0.1.0
This commit is contained in:
Harry Adel 2026-01-29 19:58:23 +02:00
parent eb0c9ac1e6
commit 7d56dca80b
6 changed files with 102 additions and 83 deletions

View file

@ -1,7 +1,7 @@
import LDAP from './ldap';
Meteor.methods({
ldap_test_connection() {
async ldap_test_connection() {
const user = Meteor.user();
if (!user) {
throw new Meteor.Error('error-invalid-user', 'Invalid user', { method: 'ldap_test_connection' });
@ -19,14 +19,14 @@ Meteor.methods({
let ldap;
try {
ldap = new LDAP();
ldap.connectSync();
await ldap.connect();
} catch (error) {
console.log(error);
throw new Meteor.Error(error.message);
}
try {
ldap.bindIfNecessary();
await ldap.bindIfNecessary();
} catch (error) {
throw new Meteor.Error(error.name || error.message);
}