File tree Expand file tree Collapse file tree 2 files changed +9
-12
lines changed
Expand file tree Collapse file tree 2 files changed +9
-12
lines changed Original file line number Diff line number Diff line change @@ -232,8 +232,15 @@ NAN_METHOD(CheckPassword) {
232232 std::string username (*Nan::Utf8String (info[0 ]));
233233 std::string password (*Nan::Utf8String (info[1 ]));
234234 std::string service (*Nan::Utf8String (info[2 ]));
235- std::string defaultRealm (*Nan::Utf8String (info[3 ]));
236- Nan::Callback* callback = new Nan::Callback (Nan::To<v8::Function>(info[4 ]).ToLocalChecked ());
235+
236+ std::string defaultRealm;
237+ Nan::Callback* callback;
238+ if (info[3 ]->IsFunction ()) {
239+ callback = new Nan::Callback (Nan::To<v8::Function>(info[3 ]).ToLocalChecked ());
240+ } else {
241+ defaultRealm = *Nan::Utf8String (info[3 ]);
242+ callback = new Nan::Callback (Nan::To<v8::Function>(info[4 ]).ToLocalChecked ());
243+ }
237244
238245 KerberosWorker::Run (callback, " kerberos:CheckPassword" , [=](KerberosWorker::SetOnFinishedHandler onFinished) {
239246 std::shared_ptr<gss_result> result (authenticate_user_krb5pwd (
Original file line number Diff line number Diff line change @@ -173,23 +173,13 @@ NAN_METHOD(InitializeClient) {
173173}
174174
175175NAN_METHOD (InitializeServer) {
176- std::string service (*Nan::Utf8String (info[0 ]));
177- Nan::Callback* callback = new Nan::Callback (Nan::To<v8::Function>(info[1 ]).ToLocalChecked ());
178176 Nan::ThrowError (" `initializeServer` is not implemented yet for windows" );
179177}
180178
181179NAN_METHOD (PrincipalDetails) {
182- std::string service (*Nan::Utf8String (info[0 ]));
183- std::string hostname (*Nan::Utf8String (info[1 ]));
184- Nan::Callback* callback = new Nan::Callback (Nan::To<v8::Function>(info[2 ]).ToLocalChecked ());
185180 Nan::ThrowError (" `principalDetails` is not implemented yet for windows" );
186181}
187182
188183NAN_METHOD (CheckPassword) {
189- std::string username (*Nan::Utf8String (info[0 ]));
190- std::string password (*Nan::Utf8String (info[1 ]));
191- std::string service (*Nan::Utf8String (info[2 ]));
192- std::string defaultRealm (*Nan::Utf8String (info[3 ]));
193- Nan::Callback* callback = new Nan::Callback (Nan::To<v8::Function>(info[4 ]).ToLocalChecked ());
194184 Nan::ThrowError (" `checkPassword` is not implemented yet for windows" );
195185}
You can’t perform that action at this time.
0 commit comments