remove user field from AuthenticationPassword structure

it's not in the spec
This commit is contained in:
Marcus Hoffmann 2021-07-01 18:01:07 +02:00
parent f5dbacfe07
commit dd7a824512
3 changed files with 3 additions and 12 deletions

View File

@ -27,7 +27,6 @@ import 'authentication_types.dart';
import 'authentication_user_identifier.dart'; import 'authentication_user_identifier.dart';
class AuthenticationPassword extends AuthenticationData { class AuthenticationPassword extends AuthenticationData {
String? user;
String password; String password;
/// You may want to cast this as [AuthenticationUserIdentifier] or other /// You may want to cast this as [AuthenticationUserIdentifier] or other
@ -35,25 +34,20 @@ class AuthenticationPassword extends AuthenticationData {
AuthenticationIdentifier identifier; AuthenticationIdentifier identifier;
AuthenticationPassword( AuthenticationPassword(
{String? session, {String? session, required this.password, required this.identifier})
required this.password,
this.user,
required this.identifier})
: super( : super(
type: AuthenticationTypes.password, type: AuthenticationTypes.password,
session: session, session: session,
); );
AuthenticationPassword.fromJson(Map<String, dynamic> json) AuthenticationPassword.fromJson(Map<String, dynamic> json)
: user = json['user'], : password = json['password'],
password = json['password'],
identifier = AuthenticationIdentifier.subFromJson(json['identifier']), identifier = AuthenticationIdentifier.subFromJson(json['identifier']),
super.fromJson(json); super.fromJson(json);
@override @override
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final data = super.toJson(); final data = super.toJson();
if (user != null) data['user'] = user;
data['password'] = password; data['password'] = password;
data['identifier'] = identifier.toJson(); data['identifier'] = identifier.toJson();
return data; return data;

View File

@ -65,7 +65,7 @@ class AuthenticationThreePidCreds extends AuthenticationData {
} }
class ThreepidCreds { class ThreepidCreds {
+ String sid; String sid;
String clientSecret; String clientSecret;
String idServer; String idServer;
String idAccessToken; String idAccessToken;

View File

@ -1905,7 +1905,6 @@ void main() {
AuthenticationPassword( AuthenticationPassword(
session: '1', session: '1',
password: 'a', password: 'a',
user: 'a',
identifier: AuthenticationUserIdentifier(user: 'a'), identifier: AuthenticationUserIdentifier(user: 'a'),
).toJson(), ).toJson(),
json); json);
@ -1919,7 +1918,6 @@ void main() {
AuthenticationPassword( AuthenticationPassword(
session: '1', session: '1',
password: 'a', password: 'a',
user: 'a',
identifier: identifier:
AuthenticationThirdPartyIdentifier(medium: 'a', address: 'a'), AuthenticationThirdPartyIdentifier(medium: 'a', address: 'a'),
).toJson(), ).toJson(),
@ -1934,7 +1932,6 @@ void main() {
AuthenticationPassword( AuthenticationPassword(
session: '1', session: '1',
password: 'a', password: 'a',
user: 'a',
identifier: AuthenticationPhoneIdentifier(country: 'a', phone: 'a'), identifier: AuthenticationPhoneIdentifier(country: 'a', phone: 'a'),
).toJson(), ).toJson(),
json); json);