getTotpUri method

Future<TwoFactorTOTPURI> getTotpUri({
  1. required String password,
})

Get TOTP URI

password The password of the user

Implementation

Future<TwoFactorTOTPURI> getTotpUri({required String password}) async {
  try {
    final response = await dio.post(
      "/two-factor/get-totp-uri",
      data: {"password": password},
      options: await super.getOptions(),
    );
    return TwoFactorTOTPURI.fromJson(response.data);
  } catch (e) {
    final message = getErrorMessage(e);
    if (message == null) rethrow;
    throw message;
  }
}