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

Method updatePassword

native/cpp/CommonCpp/NativeModules/CommRustModule.cpp:326–360  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

324}
325
326jsi::Value CommRustModule::updatePassword(
327 jsi::Runtime &rt,
328 jsi::String userID,
329 jsi::String deviceID,
330 jsi::String accessToken,
331 jsi::String oldPassword,
332 jsi::String newPassword) {
333 auto userIDRust = jsiStringToRustString(userID, rt);
334 auto deviceIDRust = jsiStringToRustString(deviceID, rt);
335 auto accessTokenRust = jsiStringToRustString(accessToken, rt);
336 auto oldPasswordRust = jsiStringToRustString(oldPassword, rt);
337 auto newPasswordRust = jsiStringToRustString(newPassword, rt);
338
339 return createPromiseAsJSIValue(
340 rt, [=, this](jsi::Runtime &innerRt, std::shared_ptr<Promise> promise) {
341 std::string error;
342 try {
343 auto currentID = RustPromiseManager::instance.addPromise(
344 {promise, this->jsInvoker_, innerRt});
345 identityUpdateUserPassword(
346 userIDRust,
347 deviceIDRust,
348 accessTokenRust,
349 oldPasswordRust,
350 newPasswordRust,
351 currentID);
352 } catch (const std::exception &e) {
353 error = e.what();
354 };
355 if (!error.empty()) {
356 this->jsInvoker_->invokeAsync(
357 [error, promise]() { promise->reject(error); });
358 }
359 });
360}
361
362jsi::Value CommRustModule::deletePasswordUser(
363 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