Authored by 毕凯

Merge branch 'hotfix/sms' into 'master'

Hotfix/sms



See merge request !1004
@@ -23,6 +23,7 @@ const thirdAccount = require('../data/third-account.json'); @@ -23,6 +23,7 @@ const thirdAccount = require('../data/third-account.json');
23 const auth = require('../models/auth-helper'); 23 const auth = require('../models/auth-helper');
24 24
25 const loginPage = `${config.siteUrl}/signin.html`; 25 const loginPage = `${config.siteUrl}/signin.html`;
  26 +const FROM = require('../../../config/from');
26 27
27 function doPassportCallback(openId, nickname, sourceType, req, res) { 28 function doPassportCallback(openId, nickname, sourceType, req, res) {
28 let shoppingKey = cookie.getShoppingKey(req); 29 let shoppingKey = cookie.getShoppingKey(req);
@@ -152,7 +153,7 @@ const common = { @@ -152,7 +153,7 @@ const common = {
152 153
153 let from = req.query.from; 154 let from = req.query.from;
154 155
155 - if (from) { 156 + if (from && FROM[from]) {
156 res.cookie('from', from, { 157 res.cookie('from', from, {
157 domain: 'yohobuy.com', 158 domain: 'yohobuy.com',
158 expires: new Date(Date.now() + 10 * 60 * 1000) 159 expires: new Date(Date.now() + 10 * 60 * 1000)