lib/oauth/error-responder.js
function oauthErrorResponder(req, res, err) {
  var accepts = req.accepts(['html', 'json']);
  var config = req.app.get('stormpathConfig');

  if (accepts === 'json') {
    return writeJsonError(res, err);
  }

  return renderLoginFormWithError(req, res, config, err);
}
function oauthErrorResponder(req, res, err) {
  var accepts = req.accepts(['html', 'json']);
  var config = req.app.get('stormpathConfig');

  if (accepts === 'json') {
    return writeJsonError(res, err);
  }

  return renderLoginFormWithError(req, res, config, err);
}
function oauthErrorResponder ( req , res , err ) { var accepts = req . accepts ( [ 'html' , 'json' ] ) ; var config = req . app . get ( 'stormpathConfig' ) ; if ( accepts === 'json' ) { return writeJsonError ( res , err ) ; } return renderLoginFormWithError ( req , res , config , err ) ; }
Takes an error object and responds either by
rendering the login form with the error, or
by returning the error as JSON.

@method

@param {Object} req - The http request.
@param {Object} res - The http response.
@param {Object} err - The error to handle.
Takes an error object and responds either by rendering the login form with the error or by returning the error as JSON .