feat: Implement UIA for login

This commit is contained in:
Christian Pauly 2020-11-09 17:15:05 +01:00
parent b0043ea0e4
commit ac4cded10f
2 changed files with 4 additions and 0 deletions

View File

@ -257,6 +257,7 @@ class MatrixApi {
String token, String token,
String deviceId, String deviceId,
String initialDeviceDisplayName, String initialDeviceDisplayName,
Map<String, dynamic> auth,
}) async { }) async {
final response = await request(RequestType.POST, '/client/r0/login', data: { final response = await request(RequestType.POST, '/client/r0/login', data: {
'type': type, 'type': type,
@ -272,6 +273,7 @@ class MatrixApi {
if (deviceId != null) 'device_id': deviceId, if (deviceId != null) 'device_id': deviceId,
if (initialDeviceDisplayName != null) if (initialDeviceDisplayName != null)
'initial_device_display_name': initialDeviceDisplayName, 'initial_device_display_name': initialDeviceDisplayName,
if (auth != null) 'auth': auth,
}); });
return LoginResponse.fromJson(response); return LoginResponse.fromJson(response);
} }

View File

@ -348,6 +348,7 @@ class Client extends MatrixApi {
String token, String token,
String deviceId, String deviceId,
String initialDeviceDisplayName, String initialDeviceDisplayName,
Map<String, dynamic> auth,
}) async { }) async {
final loginResp = await super.login( final loginResp = await super.login(
type: type, type: type,
@ -359,6 +360,7 @@ class Client extends MatrixApi {
medium: medium, medium: medium,
address: address, address: address,
token: token, token: token,
auth: auth,
); );
// Connect if there is an access token in the response. // Connect if there is an access token in the response.