mirror of
https://github.com/vector-im/element-web.git
synced 2025-12-09 11:21:33 +01:00
Do not send empty auth when setting up cross-signing keys (#29914)
* Do not send empty auth when setting up cross-signing keys My understanding from the spec is that no auth parameter should be sent when starting a UIA flow. [This section](https://spec.matrix.org/v1.14/client-server-api/#user-interactive-api-in-the-rest-api) says that "A client should first make a request with no auth parameter" and this is not what element-web is doing (since it is sending an auth parameter with an empty dictionary). In the upload cross-signing keys endpoint [documentation](https://spec.matrix.org/v1.14/client-server-api/#post_matrixclientv3keysdevice_signingupload_request_authentication-data) it says that type may be omitted if session is set, but in this specific case neither of the fields is set. * fixup! Do not send empty auth when setting up cross-signing keys
This commit is contained in:
parent
e7d940160a
commit
16773f5e4a
@ -38,10 +38,10 @@ export async function createCrossSigning(cli: MatrixClient): Promise<void> {
|
||||
|
||||
export async function uiAuthCallback(
|
||||
matrixClient: MatrixClient,
|
||||
makeRequest: (authData: AuthDict) => Promise<void>,
|
||||
makeRequest: (authData: AuthDict | null) => Promise<void>,
|
||||
): Promise<void> {
|
||||
try {
|
||||
await makeRequest({});
|
||||
await makeRequest(null);
|
||||
} catch (error) {
|
||||
if (!(error instanceof MatrixError) || !error.data || !error.data.flows) {
|
||||
// Not a UIA response
|
||||
|
||||
@ -45,7 +45,7 @@ describe("CreateCrossSigning", () => {
|
||||
|
||||
const makeRequest = jest.fn();
|
||||
await authUploadDeviceSigningKeys!(makeRequest);
|
||||
expect(makeRequest).toHaveBeenCalledWith({});
|
||||
expect(makeRequest).toHaveBeenCalledWith(null);
|
||||
});
|
||||
|
||||
it("should prompt user if upload failed with UIA", async () => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user