strategy.js 567 B

12345678910111213141516171819202122232425262728
  1. /**
  2. * Creates an instance of `Strategy`.
  3. *
  4. * @constructor
  5. * @api public
  6. */
  7. function Strategy() {
  8. }
  9. /**
  10. * Authenticate request.
  11. *
  12. * This function must be overridden by subclasses. In abstract form, it always
  13. * throws an exception.
  14. *
  15. * @param {Object} req The request to authenticate.
  16. * @param {Object} [options] Strategy-specific options.
  17. * @api public
  18. */
  19. Strategy.prototype.authenticate = function(req, options) {
  20. throw new Error('Strategy#authenticate must be overridden by subclass');
  21. };
  22. /**
  23. * Expose `Strategy`.
  24. */
  25. module.exports = Strategy;