clearAuth method

Future<void> clearAuth()

Auth request construction, HTTP POSTs, response parsing, and token refresh are owned by commons via rac_sdk_init_phase2_proto and rac_sdk_retry_http_proto. Dart only installs secure-storage callbacks and reads the resulting native auth state. Clear all auth state (in-memory + persisted via the secure-storage vtable installed at rac_auth_init). Delegates fully to the native auth manager — matches Swift CppBridge.State.clearAuth.

Implementation

/// Clear all auth state (in-memory + persisted via the secure-storage
/// vtable installed at `rac_auth_init`). Delegates fully to the native
/// auth manager — matches Swift `CppBridge.State.clearAuth`.
Future<void> clearAuth() async {
  final lib = PlatformLoader.loadCommons();
  final clearFn = lib.lookupFunction<Int32 Function(), int Function()>(
    'rac_auth_clear',
  );
  SDKException.throwIfError(clearFn());
}