Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 22nd, 2012  |  syntax: None  |  size: 0.42 KB  |  hits: 9  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. ...
  2.  
  3. function Strategy(options, verify) {
  4.   if (typeof options == 'function') {
  5.     verify = options;
  6.     options = {};
  7.   }
  8.   if (!verify) throw new Error('local authentication strategy requires a verify function');
  9.  
  10.   this._usernameField = options.usernameField || 'email';
  11.   this._passwordField = options.passwordField || 'password';
  12.  
  13.   passport.Strategy.call(this);
  14.   this.name = 'local';
  15.   this._verify = verify;
  16. }
  17.  
  18. ...