AuthSession.fromJson constructor

AuthSession.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory AuthSession.fromJson(Map<String, dynamic> json) {
  return AuthSession(
    id: json['id'] as String,
    pubkey: json['pubkey'] as String,
    type: AuthType.values.firstWhere(
      (e) => e.name == json['type'],
      orElse: () => AuthType.pubkey,
    ),
    createdAt: DateTime.parse(json['createdAt'] as String),
    privateKey: json['privateKey'] as String?,
    bunkerUrl: json['bunkerUrl'] as String?,
    token: json['token'] as String?,
  );
}