registerOtp method

Future<(String, List<String>)> registerOtp(
  1. String issuer,
  2. String audience,
  3. String password, [
  4. String? mfaToken,
  5. bool? mfaRecovery,
])

Implementation

Future<(String, List<String>)> registerOtp(
  String issuer,
  String audience,
  String password, [
  String? mfaToken,
  bool? mfaRecovery,
]) async {
  final jwt = await getFreshJwt(_userIdentifier, password, mfaToken, mfaRecovery);

  final out = await Sentc.getApi().registerOtp(
    baseUrl: baseUrl,
    authToken: appToken,
    jwt: jwt,
    issuer: issuer,
    audience: audience,
  );

  mfa = true;

  final storage = Sentc.getStorage();

  await storage.set("user_data_$_userIdentifier", jsonEncode(this));

  return (out.url, out.recover);
}