OathTokenCode.fromJson constructor

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

Deserializes the specified JSON into an OathTokenCode object.

Implementation

factory OathTokenCode.fromJson(Map<String, dynamic>? json) {
  String type = json?['oathType'];
  var oathType =
      type.toUpperCase() == 'HOTP' ? TokenType.HOTP : TokenType.TOTP;

  return OathTokenCode(
      json?['code'], json?['start'], json?['until'], oathType);
}