MCPcopy Create free account
hub / github.com/CommE2E/comm / logOut

Method logOut

native/cpp/CommonCpp/NativeModules/CommRustModule.cpp:422–446  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

420}
421
422jsi::Value CommRustModule::logOut(
423 jsi::Runtime &rt,
424 jsi::String userID,
425 jsi::String deviceID,
426 jsi::String accessToken) {
427 auto userIDRust = jsiStringToRustString(userID, rt);
428 auto deviceIDRust = jsiStringToRustString(deviceID, rt);
429 auto accessTokenRust = jsiStringToRustString(accessToken, rt);
430
431 return createPromiseAsJSIValue(
432 rt, [=, this](jsi::Runtime &innerRt, std::shared_ptr<Promise> promise) {
433 std::string error;
434 try {
435 auto currentID = RustPromiseManager::instance.addPromise(
436 {promise, this->jsInvoker_, innerRt});
437 identityLogOut(userIDRust, deviceIDRust, accessTokenRust, currentID);
438 } catch (const std::exception &e) {
439 error = e.what();
440 };
441 if (!error.empty()) {
442 this->jsInvoker_->invokeAsync(
443 [error, promise]() { promise->reject(error); });
444 }
445 });
446}
447
448jsi::Value CommRustModule::logOutPrimaryDevice(
449 jsi::Runtime &rt,

Callers

nothing calls this directly

Calls 4

jsiStringToRustStringFunction · 0.85
addPromiseMethod · 0.80
rejectMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected