From 24f0512b84ff8aab5ecd66829bc6ea5955ae8e41 Mon Sep 17 00:00:00 2001
From: paulloft
Date: Wed, 8 Nov 2023 16:55:47 +0400
Subject: [PATCH 1/2] Resolves #29285
---
apps/meteor/app/crowd/server/crowd.ts | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/apps/meteor/app/crowd/server/crowd.ts b/apps/meteor/app/crowd/server/crowd.ts
index b6b94f33e5668..6e82eb7277f17 100644
--- a/apps/meteor/app/crowd/server/crowd.ts
+++ b/apps/meteor/app/crowd/server/crowd.ts
@@ -66,14 +66,18 @@ export class CROWD {
};
this.crowdClient = new AtlassianCrowd(this.options);
+ this.crowdClient.user.authenticateSync = Meteor.wrapAsync(this.crowdClient.user.authenticate, this);
+ this.crowdClient.user.findSync = Meteor.wrapAsync(this.crowdClient.user.find, this);
+ this.crowdClient.searchSync = Meteor.wrapAsync(this.crowdClient.search, this);
+ this.crowdClient.pingSync = Meteor.wrapAsync(this.crowdClient.ping, this);
}
async checkConnection() {
- await this.crowdClient.ping();
+ this.crowdClient.ping();
}
- async fetchCrowdUser(crowdUsername: string) {
- const userResponse = await this.crowdClient.user.find(crowdUsername);
+ fetchCrowdUser(crowdUsername: string) {
+ const userResponse = this.crowdClient.user.findSync(crowdUsername);
return {
displayname: userResponse['display-name'],
@@ -134,13 +138,13 @@ export class CROWD {
logger.debug('New user. User is not synced yet.');
}
logger.debug('Going to crowd:', crowdUsername);
- const auth = await this.crowdClient.user.authenticate(crowdUsername, password);
+ const auth = this.crowdClient.user.authenticateSync(crowdUsername, password);
if (!auth) {
return;
}
- const crowdUser: Record = await this.fetchCrowdUser(crowdUsername);
+ const crowdUser: Record = this.fetchCrowdUser(crowdUsername);
if (user && settings.get('CROWD_Allow_Custom_Username') === true) {
crowdUser.username = user.username;
@@ -211,7 +215,7 @@ export class CROWD {
let crowdUser = null;
try {
- crowdUser = await this.fetchCrowdUser(crowdUsername);
+ crowdUser = this.fetchCrowdUser(crowdUsername);
} catch (err) {
logger.debug({ err });
logger.error({ msg: 'Could not sync user with username', crowd_username: crowdUsername });
@@ -238,7 +242,7 @@ export class CROWD {
continue;
}
- crowdUser = await this.fetchCrowdUser(crowdUsername);
+ crowdUser = this.fetchCrowdUser(crowdUsername);
}
if (settings.get('CROWD_Allow_Custom_Username') === true) {
From 53dc23c9a3eacd47fa45ca10b85fdd6461c4f234 Mon Sep 17 00:00:00 2001
From: paulloft
Date: Wed, 8 Nov 2023 17:21:22 +0400
Subject: [PATCH 2/2] fix ping
---
apps/meteor/app/crowd/server/crowd.ts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/apps/meteor/app/crowd/server/crowd.ts b/apps/meteor/app/crowd/server/crowd.ts
index 6e82eb7277f17..a3d3b3c75d90e 100644
--- a/apps/meteor/app/crowd/server/crowd.ts
+++ b/apps/meteor/app/crowd/server/crowd.ts
@@ -73,7 +73,7 @@ export class CROWD {
}
async checkConnection() {
- this.crowdClient.ping();
+ this.crowdClient.pingSync();
}
fetchCrowdUser(crowdUsername: string) {