deleteDevice method

Future<void> deleteDevice(
  1. String password,
  2. String deviceId, [
  3. String? mfaToken,
  4. bool? mfaRecovery,
])

Implementation

Future<void> deleteDevice(String password, String deviceId, [String? mfaToken, bool? mfaRecovery]) async {
  final jwt = await getFreshJwt(_userIdentifier, password, mfaToken, mfaRecovery);

  await Sentc.getApi().deleteDevice(baseUrl: baseUrl, authToken: appToken, freshJwt: jwt, deviceId: deviceId);

  if (deviceId == this.deviceId) {
    //only log the device out if it is the actual used device
    return logOut();
  }
}