From ac4cded10fc8bb2157f58e18df292e50f4c7c0b3 Mon Sep 17 00:00:00 2001 From: Christian Pauly Date: Mon, 9 Nov 2020 17:15:05 +0100 Subject: [PATCH] feat: Implement UIA for login --- lib/matrix_api/matrix_api.dart | 2 ++ lib/src/client.dart | 2 ++ 2 files changed, 4 insertions(+) diff --git a/lib/matrix_api/matrix_api.dart b/lib/matrix_api/matrix_api.dart index c3dd5f04..a8ae5c1c 100644 --- a/lib/matrix_api/matrix_api.dart +++ b/lib/matrix_api/matrix_api.dart @@ -257,6 +257,7 @@ class MatrixApi { String token, String deviceId, String initialDeviceDisplayName, + Map auth, }) async { final response = await request(RequestType.POST, '/client/r0/login', data: { 'type': type, @@ -272,6 +273,7 @@ class MatrixApi { if (deviceId != null) 'device_id': deviceId, if (initialDeviceDisplayName != null) 'initial_device_display_name': initialDeviceDisplayName, + if (auth != null) 'auth': auth, }); return LoginResponse.fromJson(response); } diff --git a/lib/src/client.dart b/lib/src/client.dart index 4d9f5703..251e0c2b 100644 --- a/lib/src/client.dart +++ b/lib/src/client.dart @@ -348,6 +348,7 @@ class Client extends MatrixApi { String token, String deviceId, String initialDeviceDisplayName, + Map auth, }) async { final loginResp = await super.login( type: type, @@ -359,6 +360,7 @@ class Client extends MatrixApi { medium: medium, address: address, token: token, + auth: auth, ); // Connect if there is an access token in the response.