From 95fb97af3e9fa30195c81f6630ec6e0132f6e8bc Mon Sep 17 00:00:00 2001 From: dklimpel <5740567+dklimpel@users.noreply.github.com> Date: Mon, 19 Aug 2024 16:07:46 +0200 Subject: [PATCH 1/2] Add identifier when login with password --- src/synapse/authProvider.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/synapse/authProvider.ts b/src/synapse/authProvider.ts index d84fab1a..26d26ef5 100644 --- a/src/synapse/authProvider.ts +++ b/src/synapse/authProvider.ts @@ -31,6 +31,10 @@ const authProvider: AuthProvider = { type: "m.login.password", user: username, password: password, + identifier: { + type: "m.id.user", + user: username, + }, } ) ), From f380e6a46ac14e46eb0040a3df09376c22e54cc8 Mon Sep 17 00:00:00 2001 From: dklimpel <5740567+dklimpel@users.noreply.github.com> Date: Mon, 19 Aug 2024 16:21:02 +0200 Subject: [PATCH 2/2] add identifier to unit tests --- src/synapse/authProvider.test.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/synapse/authProvider.test.ts b/src/synapse/authProvider.test.ts index 45335fc9..afb8a785 100644 --- a/src/synapse/authProvider.test.ts +++ b/src/synapse/authProvider.test.ts @@ -29,7 +29,17 @@ describe("authProvider", () => { expect(ret).toBe(undefined); expect(fetch).toBeCalledWith("http://example.com/_matrix/client/r0/login", { - body: '{"device_id":null,"initial_device_display_name":"Synapse Admin","type":"m.login.password","user":"@user:example.com","password":"secret"}', + body: JSON.stringify({ + device_id: null, + initial_device_display_name: "Synapse Admin", + type: "m.login.password", + user: "@user:example.com", + password: "secret", + identifier: { + type: "m.id.user", + user: "@user:example.com", + } + }), headers: new Headers({ Accept: "application/json", "Content-Type": "application/json",