remove user field from AuthenticationPassword structure
it's not in the spec
This commit is contained in:
parent
f5dbacfe07
commit
dd7a824512
|
|
@ -27,7 +27,6 @@ import 'authentication_types.dart';
|
|||
import 'authentication_user_identifier.dart';
|
||||
|
||||
class AuthenticationPassword extends AuthenticationData {
|
||||
String? user;
|
||||
String password;
|
||||
|
||||
/// You may want to cast this as [AuthenticationUserIdentifier] or other
|
||||
|
|
@ -35,25 +34,20 @@ class AuthenticationPassword extends AuthenticationData {
|
|||
AuthenticationIdentifier identifier;
|
||||
|
||||
AuthenticationPassword(
|
||||
{String? session,
|
||||
required this.password,
|
||||
this.user,
|
||||
required this.identifier})
|
||||
{String? session, required this.password, required this.identifier})
|
||||
: super(
|
||||
type: AuthenticationTypes.password,
|
||||
session: session,
|
||||
);
|
||||
|
||||
AuthenticationPassword.fromJson(Map<String, dynamic> json)
|
||||
: user = json['user'],
|
||||
password = json['password'],
|
||||
: password = json['password'],
|
||||
identifier = AuthenticationIdentifier.subFromJson(json['identifier']),
|
||||
super.fromJson(json);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
final data = super.toJson();
|
||||
if (user != null) data['user'] = user;
|
||||
data['password'] = password;
|
||||
data['identifier'] = identifier.toJson();
|
||||
return data;
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ class AuthenticationThreePidCreds extends AuthenticationData {
|
|||
}
|
||||
|
||||
class ThreepidCreds {
|
||||
+ String sid;
|
||||
String sid;
|
||||
String clientSecret;
|
||||
String idServer;
|
||||
String idAccessToken;
|
||||
|
|
|
|||
|
|
@ -1905,7 +1905,6 @@ void main() {
|
|||
AuthenticationPassword(
|
||||
session: '1',
|
||||
password: 'a',
|
||||
user: 'a',
|
||||
identifier: AuthenticationUserIdentifier(user: 'a'),
|
||||
).toJson(),
|
||||
json);
|
||||
|
|
@ -1919,7 +1918,6 @@ void main() {
|
|||
AuthenticationPassword(
|
||||
session: '1',
|
||||
password: 'a',
|
||||
user: 'a',
|
||||
identifier:
|
||||
AuthenticationThirdPartyIdentifier(medium: 'a', address: 'a'),
|
||||
).toJson(),
|
||||
|
|
@ -1934,7 +1932,6 @@ void main() {
|
|||
AuthenticationPassword(
|
||||
session: '1',
|
||||
password: 'a',
|
||||
user: 'a',
|
||||
identifier: AuthenticationPhoneIdentifier(country: 'a', phone: 'a'),
|
||||
).toJson(),
|
||||
json);
|
||||
|
|
|
|||
Loading…
Reference in New Issue