From 5e06721639728d9e146c0058961b73e5edbb31b5 Mon Sep 17 00:00:00 2001 From: Krille Fear Date: Mon, 30 Aug 2021 07:55:21 +0000 Subject: [PATCH] fix: Make type in AuthenticationData nullable It seems that there is a problem in the matrix Spec according to this. the Spec says that the type is required and session is nullable. But for using this endpoint: https://spec.matrix.org/unstable/client-server-api/#client-behaviour-1-1 We need to send an auth object which only contains the session. We should file an issue at the spec and ask there for more information. Currently we should make type nullable as well because otherwise this would break uiaRequests in the app for SSO. --- lib/src/model/auth/authentication_data.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/src/model/auth/authentication_data.dart b/lib/src/model/auth/authentication_data.dart index 3a561798..1f4cfc31 100644 --- a/lib/src/model/auth/authentication_data.dart +++ b/lib/src/model/auth/authentication_data.dart @@ -22,10 +22,10 @@ */ class AuthenticationData { - String type; + String? type; String? session; - AuthenticationData({required this.type, this.session}); + AuthenticationData({this.type, this.session}); AuthenticationData.fromJson(Map json) : type = json['type'], @@ -33,7 +33,7 @@ class AuthenticationData { Map toJson() { final data = {}; - data['type'] = type; + if (type != null) data['type'] = type; if (session != null) data['session'] = session; return data; }