cancelAuthenticate function
Aborts any in-flight desktop authenticate call. The awaited future throws an AuthCancelledException, the local OAuth callback HTTP server is closed when no other flow needs it, and the cached authenticator reference is cleared.
Implementation
Future<void> cancelAuthenticate() async {
final pending = _pendingAuthenticator;
if (pending == null) return;
_pendingAuthenticator = null;
await pending.cancel();
}