javascript - Find out where Node is freezing? -


i'm setting passport authenticate via ldap (using passport-ldap) , whenever user fails log in, loads failuredirect link. however, if log in (or think) program hangs. there aren't errors received; browser seems it's loading ("waiting server..."). there way see passport freezing without going through entire trace of functions called , putting console.log statement in each function?

in routes:

app.post('/users/session',   passport.authenticate('ldap', {     failureredirect: '/login_fail',     successredirect: '/admin'   }), users.session) 

in passport.js file:

var ldapstrategy = require('passport-ldap').strategy  [...]  passport.use(new ldapstrategy({   server:{     url: 'ldap://[my_url]:3268',     },   base: '[hidden]',   search: {     filter: "(&(objectclass=user)(samaccountname={{username}}))",     }   },   function(user, done) {     console.log("success")     return done(null, json.parse(user));   } )) 

node debugger might bit verbose. old console.error should trick. interface identical console.log, instead console.error blocks until io complete display text. give accurate indication code died. downside have add few lines of code this:

console.error( 'debug1' ); console.error( 'debug2' ); console.error( 'debug3' ); 

Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

.htaccess - Matching full URL in RewriteCond -