Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supporting Node 14 #44

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sspi-client",
"version": "0.1.0",
"version": "0.1.1",
"description": "SSPI Client Library.",
"author": "Prasad Tammana <prasadgithub@gmail.com>",
"license": "MIT",
Expand Down
12 changes: 6 additions & 6 deletions src_native/sspi_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ NAN_METHOD(InitializeAsync)
NAN_METHOD(EnableDebugLogging)
{
DebugLog("%ul: Main event loop: EnableDebugLogging NAN_METHOD.\n", GetCurrentThreadId());
SetDebugLogging(info[0]->BooleanValue());
SetDebugLogging(Nan::To<bool>(info[0]).FromJust());
}

// Native implementation of SspiClient surfaced to JavaScript.
Expand Down Expand Up @@ -286,13 +286,13 @@ class SspiClientObject : public Nan::ObjectWrap
{
DebugLog("%ul: Main event loop: SspiClientObject::GetNextBlob.\n", GetCurrentThreadId());

int inBlobBeginOffset = static_cast<int>(info[1]->IntegerValue());
int inBlobLength = static_cast<int>(info[2]->IntegerValue());
int inBlobBeginOffset = static_cast<int>(Nan::To<int>(info[1]).FromJust());
int inBlobLength = static_cast<int>(Nan::To<int>(info[2]).FromJust());

char* inBlob = nullptr;
if (inBlobLength > 0)
{
inBlob = node::Buffer::Data(info[0]->ToObject());
inBlob = node::Buffer::Data(info[0]->ToObject(Nan::GetCurrentContext()).ToLocalChecked());
}

Nan::Callback* callback = new Nan::Callback(info[3].As<v8::Function>());
Expand All @@ -309,14 +309,14 @@ class SspiClientObject : public Nan::ObjectWrap
{
DebugLog("%ul: Main event loop: SspiClientObject::UtEnableCannedResponse.\n", GetCurrentThreadId());
SspiClientObject* sspiClientObject = Nan::ObjectWrap::Unwrap<SspiClientObject>(info.Holder());
sspiClientObject->m_sspiImpl->UtEnableCannedResponse(info[0]->BooleanValue());
sspiClientObject->m_sspiImpl->UtEnableCannedResponse(Nan::To<bool>(info[0]).FromJust());
}

static NAN_METHOD(UtForceCompleteAuth)
{
DebugLog("%ul: Main event loop: SspiClientObject::UtForceCompleteAuth.\n", GetCurrentThreadId());
SspiClientObject* sspiClientObject = Nan::ObjectWrap::Unwrap<SspiClientObject>(info.Holder());
sspiClientObject->m_sspiImpl->UtForceCompleteAuth(info[0]->BooleanValue());
sspiClientObject->m_sspiImpl->UtForceCompleteAuth(Nan::To<bool>(info[0]).FromJust());
}

// This is a shared pointer because we pass this to
Expand Down