File tree Expand file tree Collapse file tree 2 files changed +3
-1
lines changed
Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -144,7 +144,8 @@ Client::Client(const Napi::CallbackInfo &info) : Napi::ObjectWrap<Client>(info)
144144 if (clientConfig.Has (CFG_AUTH) && clientConfig.Get (CFG_AUTH).IsObject ()) {
145145 Napi::Object obj = clientConfig.Get (CFG_AUTH).ToObject ();
146146 if (obj.Has (CFG_AUTH_PROP) && obj.Get (CFG_AUTH_PROP).IsObject ()) {
147- Authentication *auth = Authentication::Unwrap (obj.Get (CFG_AUTH_PROP).ToObject ());
147+ this ->authRef_ = Napi::Persistent (obj.Get (CFG_AUTH_PROP).As <Napi::Object>());
148+ Authentication *auth = Authentication::Unwrap (this ->authRef_ .Value ());
148149 pulsar_client_configuration_set_auth (cClientConfig.get (), auth->GetCAuthentication ());
149150 }
150151 }
Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ class Client : public Napi::ObjectWrap<Client> {
5454 std::shared_ptr<pulsar_client_t > cClient;
5555 std::shared_ptr<pulsar_client_configuration_t > cClientConfig;
5656 pulsar_logger_level_t logLevel = pulsar_logger_level_t ::pulsar_INFO;
57+ Napi::ObjectReference authRef_;
5758
5859 Napi::Value CreateProducer (const Napi::CallbackInfo &info);
5960 Napi::Value Subscribe (const Napi::CallbackInfo &info);
You can’t perform that action at this time.
0 commit comments