0
0
Fork 1
mirror of https://mau.dev/maunium/synapse.git synced 2024-12-15 06:13:52 +01:00

rework format of change password capability

This commit is contained in:
Neil Johnson 2019-01-29 18:04:56 +00:00
parent 19259d903c
commit e4bef9d470
2 changed files with 5 additions and 3 deletions

View file

@ -55,7 +55,9 @@ class CapabilitiesRestServlet(RestServlet):
"state-v2-test": "unstable",
}
},
"m.change_password": change_password,
"m.change_password": {
"enabled": change_password,
},
}
})
)

View file

@ -68,11 +68,11 @@ class CapabilitiesTestCase(unittest.HomeserverTestCase):
self.assertEqual(channel.code, 200)
# Test case where password is handled outside of Synapse
self.assertTrue(capabilities['m.change_password'])
self.assertTrue(capabilities['m.change_password']['enabled'])
self.get_success(self.store.user_set_password_hash(user, None))
request, channel = self.make_request("GET", self.url, access_token=access_token)
self.render(request)
capabilities = channel.json_body['capabilities']
self.assertEqual(channel.code, 200)
self.assertFalse(capabilities['m.change_password'])
self.assertFalse(capabilities['m.change_password']['enabled'])