cleanUp

abstract suspend fun cleanUp(context: Context, backup: (context: Context) -> Unit = {})

Removes legacy authenticator data after a successful migration.

Called as the final step of the migration pipeline. Implement this to delete SharedPreferences entries, database rows, remote records, or any other storage your backend uses.

The backup callback is forwarded from LegacyAuthenticationConfig.backup. Invoke it before clearing the storage to persist a copy of the data. Pass a no-op (the default) to skip backup. For StorageClientProvider, this callback is invoked unconditionally so the caller fully controls whether backup happens.

Parameters

context

The Android application context.

backup

A callback to invoke before clearing data. Defaults to a no-op.