<commit_before>var fallback = function (req, res, next, forceParam, route) {
  var url = req.path;
  var page = null;
  if(UtilityService.isDefined(route) && UtilityService.isDefined(route.state) && UtilityService.isDefined(route.state.name)) page = route.state.name;
  switch(req.path) {
    case "/signin":
      return signin(req, res, next, forceParam, showLegacyToast = true, page, route);
    default:
      return updateBrowser(req, res, next, forceParam, showLegacyToast = true, page, route);
  }
};

/*
 * fallback html page to allow browser to auto-fill e-mail and password
 */
var signin = function(req, res, next, force, showLegacyToast, page, route) {
  return ThemeService.view(host, 'views/fallback/signin.jade', res,  { showLegacyToast: false, flash: flash });
}

var updateBrowser = function (req, res, next, force, showLegacyToast, page, route) {
  var routes = null;

  var host = req.session.uri.host;
  var site = null;
  var url = req.path;
  var title = "";
  if(UtilityService.isDefined(route) && UtilityService.isDefined(route.sitetitle)) title = route.sitetitle;

  MultisiteService.getCurrentSiteConfig(host, function (err, config) {
    if(err) return res.serverError(err);
    site = config.name;
    async.parallel([
      function(callback) {
        RoutesService.find(host, {}, function(err, routes) {
          callback(err, routes);
        });
      }
    ], function (err, results) {
      if(err) return res.serverError(err);

      routes = results[0];

      return ThemeService.view(req.session.uri.host, 'views/fallback/browser.jade', res, {
        showLegacyToast: showLegacyToast,
        force: force,
        host: host,
        url: url,
        routes: routes,
        useragent: req.useragent,
        title: title,
        config: {paths: sails.config.paths},
        isFallback: true,
        isModern: false,
        authenticated: false
      });
    });
  });
};

module.exports = {
  updateBrowser: updateBrowser
  , fallback: fallback
  , signin: signin
};

<commit_msg>fix fallback signin<commit_after>var fallback = function (req, res, next, forceParam, route) {
  var url = req.path;
  var page = null;
  if(UtilityService.isDefined(route) && UtilityService.isDefined(route.state) && UtilityService.isDefined(route.state.name)) page = route.state.name;
  switch(req.path) {
    case "/signin":
      return signin(req, res, next, forceParam, showLegacyToast = true, page, route);
    default:
      return updateBrowser(req, res, next, forceParam, showLegacyToast = true, page, route);
  }
};

/*
 * fallback html page to allow browser to auto-fill e-mail and password
 */
var signin = function(req, res, next, force, showLegacyToast, page, route) {
  var host = req.session.uri.host;
  var flash = req.session.flash;
  return ThemeService.view(host, 'views/fallback/signin.jade', res,  { showLegacyToast: false, flash: flash });
}

var updateBrowser = function (req, res, next, force, showLegacyToast, page, route) {
  var routes = null;

  var host = req.session.uri.host;
  var site = null;
  var url = req.path;
  var title = "";
  if(UtilityService.isDefined(route) && UtilityService.isDefined(route.sitetitle)) title = route.sitetitle;

  MultisiteService.getCurrentSiteConfig(host, function (err, config) {
    if(err) return res.serverError(err);
    site = config.name;
    async.parallel([
      function(callback) {
        RoutesService.find(host, {}, function(err, routes) {
          callback(err, routes);
        });
      }
    ], function (err, results) {
      if(err) return res.serverError(err);

      routes = results[0];

      return ThemeService.view(req.session.uri.host, 'views/fallback/browser.jade', res, {
        showLegacyToast: showLegacyToast,
        force: force,
        host: host,
        url: url,
        routes: routes,
        useragent: req.useragent,
        title: title,
        config: {paths: sails.config.paths},
        isFallback: true,
        isModern: false,
        authenticated: false
      });
    });
  });
};

module.exports = {
  updateBrowser: updateBrowser
  , fallback: fallback
  , signin: signin
};


{'fraction_non_alphanumeric': 0.12960271317829458, 'fraction_numerical': 0.00048449612403100775, 'mean_word_length': 3.17914979757085, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4424119', 'n_tokens_mistral': 1335, 'n_tokens_neox': 1321, 'n_words': 318}