From ef4a010e14163c3a91e54acf4f801efa79bc73a9 Mon Sep 17 00:00:00 2001 From: Ariel Gentile Date: Wed, 2 Aug 2023 09:01:10 -0300 Subject: [PATCH] fix(js): storeRekey in React Native Signed-off-by: Ariel Gentile --- .../aries-askar-react-native/cpp/ariesAskar.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/wrappers/javascript/aries-askar-react-native/cpp/ariesAskar.cpp b/wrappers/javascript/aries-askar-react-native/cpp/ariesAskar.cpp index 9e0230b3..12e172a9 100644 --- a/wrappers/javascript/aries-askar-react-native/cpp/ariesAskar.cpp +++ b/wrappers/javascript/aries-askar-react-native/cpp/ariesAskar.cpp @@ -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(rt, options, "storeHandle"); - auto keyMethod = jsiToValue(rt, options, "keyMethod"); + auto keyMethod = jsiToValue(rt, options, "keyMethod", true); auto passKey = jsiToValue(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); }