Skip to content

Commit

Permalink
Add identifier when authorizing with password
Browse files Browse the repository at this point in the history
This PR is almost copy of Awesome-Technologies/synapse-admin#601 PR,
authored by @dklimpel
  • Loading branch information
aine-etke committed Sep 3, 2024
1 parent 678867e commit 7747dc7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
branches: [ "main" ]
env:
upstream_version: v0.10.3
etke_version: etke2
etke_version: etke3
bunny_version: v0.1.0
permissions:
checks: write
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ The following changes are already implemented:

* [Prevent admins from deleting themselves](https://github.com/etkecc/synapse-admin/pull/1)
* [Fix user's default tab not being shown](https://github.com/etkecc/synapse-admin/pull/8)
* [Add identifier when authorizing with password](https://github.com/Awesome-Technologies/synapse-admin/pull/601)

_the list will be updated as new changes are added_

Expand Down
2 changes: 1 addition & 1 deletion src/synapse/authProvider.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ 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: '{"device_id":null,"initial_device_display_name":"Synapse Admin","type":"m.login.password","identifier":{"type":"m.id.user","user":"@user:example.com"},"password":"secret"}',
headers: new Headers({
Accept: "application/json",
"Content-Type": "application/json",
Expand Down
5 changes: 4 additions & 1 deletion src/synapse/authProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ const authProvider: AuthProvider = {
}
: {
type: "m.login.password",
user: username,
identifier: {
type: "m.id.user",
user: username,
},
password: password,
}
)
Expand Down

0 comments on commit 7747dc7

Please sign in to comment.