Skip to content

Commit

Permalink
fix(js): storeRekey in React Native (#161)
Browse files Browse the repository at this point in the history
Signed-off-by: Ariel Gentile <[email protected]>
  • Loading branch information
genaris authored Aug 2, 2023
1 parent 3f55072 commit 6af7ebc
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -179,16 +179,17 @@ jsi::Value storeGetProfileName(jsi::Runtime &rt, jsi::Object options) {

jsi::Value storeRekey(jsi::Runtime &rt, jsi::Object options) {
auto storeHandle = jsiToValue<int64_t>(rt, options, "storeHandle");
auto keyMethod = jsiToValue<std::string>(rt, options, "keyMethod");
auto keyMethod = jsiToValue<std::string>(rt, options, "keyMethod", true);
auto passKey = jsiToValue<std::string>(rt, options, "passKey");

jsi::Function cb = options.getPropertyAsFunction(rt, "cb");
State *state = new State(&cb);
state->rt = &rt;

ErrorCode code = askar_store_get_profile_name(
storeHandle, callbackWithResponse, CallbackId(state));

ErrorCode code = askar_store_rekey(storeHandle,
keyMethod.length() ? keyMethod.c_str() : nullptr,
passKey.c_str(), callback, CallbackId(state));

return createReturnValue(rt, code, nullptr);
}

Expand Down

0 comments on commit 6af7ebc

Please sign in to comment.