diff --git a/binding.gyp b/binding.gyp index c933421..8ecef94 100644 --- a/binding.gyp +++ b/binding.gyp @@ -2,38 +2,23 @@ "targets": [ { "target_name": "NodeSSPI", - "cflags!": [ "-fno-exceptions" ], - "cflags_cc!": [ "-fno-exceptions" ], - "xcode_settings": { "GCC_ENABLE_CPP_EXCEPTIONS": "YES", - "CLANG_CXX_LIBRARY": "libc++", - "MACOSX_DEPLOYMENT_TARGET": "10.7", - }, + "cflags!": ["-fno-exceptions"], + "cflags_cc!": ["-fno-exceptions"], "msvs_settings": { - "VCCLCompilerTool": { "ExceptionHandling": 1 }, + "VCCLCompilerTool": { "ExceptionHandling": 1 } }, - "sources": [ - "src/*.h", - "src/*.cpp", - ], - 'defines': [ - '_UNICODE', - 'UNICODE', - ], - 'configurations': { - 'Release': { - 'msvs_settings': { - 'VCCLCompilerTool': { - 'ExceptionHandling': 1, + "sources": ["src/*.h", "src/*.cpp"], + "defines": ["_UNICODE", "UNICODE"], + "configurations": { + "Release": { + "msvs_settings": { + "VCCLCompilerTool": { + "ExceptionHandling": 1 } - } + } } }, - "include_dirs" : [ - " - - org.netbeans.modules.web.clientproject - - - node-sspi - - - diff --git a/package-lock.json b/package-lock.json index 3ffeaef..7a02540 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "node-sspi", - "version": "0.2.5", + "version": "0.2.6", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -9,11 +9,6 @@ "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.2.1.tgz", "integrity": "sha1-FK1hE4EtLTfXLme0ystLtyZQXxE=" }, - "nan": { - "version": "2.11.1", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.11.1.tgz", - "integrity": "sha512-iji6k87OSXa0CcrLl9z+ZiYSuR2o+c0bGuNmXdrhTQTakxytAFsC56SArGYoiHlJlFoHSnvmhpceZJaXkVuOtA==" - }, "node-addon-api": { "version": "1.7.1", "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-1.7.1.tgz", diff --git a/package.json b/package.json index 4bb0298..e5fb7d6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "node-sspi", - "version": "0.2.5", + "version": "0.2.6", "description": "Windows SSPI server-side authentication for Node", "main": "index.js", "author": "Fred Wen", @@ -9,7 +9,7 @@ "install": "node ./build.js" }, "dependencies": { - "node-addon-api": "1.7.1", + "node-addon-api": "^1.7.1", "bindings": "^1.1.1" }, "engines": { diff --git a/src/NodeSSPI.cpp b/src/NodeSSPI.cpp index 86e6cd0..19639db 100644 --- a/src/NodeSSPI.cpp +++ b/src/NodeSSPI.cpp @@ -408,7 +408,8 @@ void WrapUpAsyncAfterAuth(const Env env, Baton* pBaton) { } } else { - if (lRes.Get(Napi::String::New(env, "statusCode")).As().Int32Value() == 401) { + Napi::Value v = lRes.Get(Napi::String::New(env, "statusCode")); + if (v.IsNumber() && v.ToNumber().Int32Value() == 401) { napi_value argv[] = { Napi::String::New(env, "Login aborted.") }; if (lOpts.Get(Napi::String::New(env, "authoritative")).As().Value()) { lRes.Get(Napi::String::New(env, "end")).As().Call(lRes, 1, argv);