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 deviceId,
String initialDeviceDisplayName,
Map<String, dynamic> 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);
}

View File

@ -348,6 +348,7 @@ class Client extends MatrixApi {
String token,
String deviceId,
String initialDeviceDisplayName,
Map<String, dynamic> 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.