Files
workavia-mail-front/model/lib/account/account_request.dart
T
dab246 876cc368b0 Use TupleKey(ObjectKey-AccountId-UserName) to store data to hive
(cherry picked from commit e0ace535d5f3af71eb13598d92524caf2c6d9bbf)
2023-05-08 13:03:51 +07:00

28 lines
800 B
Dart

import 'dart:convert';
import 'package:equatable/equatable.dart';
import 'package:jmap_dart_client/jmap/core/user_name.dart';
import 'package:model/account/authentication_type.dart';
import 'package:model/account/password.dart';
import 'package:model/oidc/token.dart';
class AccountRequest with EquatableMixin {
final UserName? userName;
final Password? password;
final Token? token;
final AuthenticationType authenticationType;
AccountRequest({
this.userName,
this.password,
this.token,
this.authenticationType = AuthenticationType.none,
});
String get basicAuth => 'Basic ${base64Encode(utf8.encode('${userName?.value}:${password?.value}'))}';
String get bearerToken => 'Bearer ${token?.token}';
@override
List<Object?> get props => [userName, password];
}