Add identifier when login with password (#601)

* Add identifier when login with password
* add identifier to unit tests
This commit is contained in:
Dirk Klimpel 2025-05-09 17:16:46 +02:00 committed by Manuel Stahl
parent ad876bb790
commit 61c32fb473
2 changed files with 15 additions and 1 deletions

View File

@ -30,7 +30,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",

View File

@ -33,6 +33,10 @@ const authProvider: AuthProvider = {
type: "m.login.password",
user: username,
password: password,
identifier: {
type: "m.id.user",
user: username,
},
}
)
),