famedly / matrix-dart-sdk

Matrix SDK written in pure Dart.
GNU Affero General Public License v3.0
58 stars 31 forks source link

Add support for AuthenticationRegistrationToken #371

Open famedly-bot opened 1 year ago

famedly-bot commented 1 year ago

In GitLab by @gimmix on Apr 16, 2023, 14:28

Currently there doesn't seem to be a AuthenticationRegistrationToken for m.login.registration_token out of the box. It is easy enough to implement yourself but might be nice if it where alreay included.

This is what my implementation based on the AuthenticationToken looks like:

class AuthenticationRegistrationToken extends AuthenticationToken {
  AuthenticationRegistrationToken({required super.token, super.session, super.txnId});

  @override
  Map<String, dynamic> toJson() {
    var json = super.toJson();
    json.addAll({
      "type": "m.login.registration_token",
    });
    return json;
  }
}
famedly-bot commented 1 year ago

In GitLab by @kristiangronas on May 4, 2023, 23:24

mentioned in merge request famedly/company/frontend/libraries/matrix_api_lite!94