1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-08-09 10:22:46 +03:00

Fix 3pid invite acceptance not working due to mxid being sent in body (#2907)

This commit is contained in:
Michael Telatynski
2022-11-25 09:22:10 +00:00
committed by GitHub
parent 77d6def1cc
commit 007b7dd242
2 changed files with 6 additions and 5 deletions

View File

@@ -173,7 +173,9 @@ describe("MatrixClient", function() {
signatures: {},
};
httpBackend!.when("POST", inviteSignUrl).respond(200, signature);
httpBackend!.when("POST", inviteSignUrl).check(request => {
expect(request.queryParams?.mxid).toEqual(client!.getUserId());
}).respond(200, signature);
httpBackend!.when("POST", "/join/" + encodeURIComponent(roomId)).check(request => {
expect(request.data.third_party_signed).toEqual(signature);
}).respond(200, { room_id: roomId });

View File

@@ -3629,10 +3629,9 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
let signPromise: Promise<IThirdPartySigned | void> = Promise.resolve();
if (opts.inviteSignUrl) {
signPromise = this.http.requestOtherUrl<IThirdPartySigned>(
Method.Post,
new URL(opts.inviteSignUrl), { mxid: this.credentials.userId },
);
const url = new URL(opts.inviteSignUrl);
url.searchParams.set("mxid", this.credentials.userId!);
signPromise = this.http.requestOtherUrl<IThirdPartySigned>(Method.Post, url);
}
const queryString: Record<string, string | string[]> = {};