...
|
...
|
@@ -70,7 +70,7 @@ const common = { |
|
|
let refer = req.query.refer || req.get('Referer');
|
|
|
|
|
|
refer && res.cookie('refer', encodeURI(refer), {
|
|
|
domain: '.yohobuy.com'
|
|
|
domain: config.cookieDomain
|
|
|
});
|
|
|
next();
|
|
|
},
|
...
|
...
|
@@ -98,12 +98,14 @@ const local = { |
|
|
loginPage: (req, res) => {
|
|
|
// 清除cookie
|
|
|
res.clearCookie('_UID', {
|
|
|
domain: '.yohobuy.com'
|
|
|
domain: config.cookieDomain
|
|
|
});
|
|
|
res.clearCookie('_TOKEN', {
|
|
|
domain: '.yohobuy.com'
|
|
|
domain: config.cookieDomain
|
|
|
});
|
|
|
|
|
|
req.session = null;
|
|
|
|
|
|
let bindMobile = _.trim(req.query.bindMobile || '');
|
|
|
let bindArea = '+' + _.trim(req.query.bindArea || '86');
|
|
|
let areaArr = PassportHelper.getCountry();
|
...
|
...
|
@@ -190,10 +192,10 @@ const local = { |
|
|
req.session = null;
|
|
|
|
|
|
res.clearCookie('_UID', {
|
|
|
domain: 'yohobuy.com'
|
|
|
domain: config.cookieDomain
|
|
|
});
|
|
|
res.clearCookie('_TOKEN', {
|
|
|
domain: 'yohobuy.com'
|
|
|
res.clearCookie('TOKEN_', {
|
|
|
domain: config.cookieDomain
|
|
|
});
|
|
|
res.clearCookie('_SPK');
|
|
|
res.clearCookie('_g');
|
...
|
...
|
@@ -366,7 +368,6 @@ const local = { |
|
|
|
|
|
const wechat = {
|
|
|
login: (req, res, next) => {
|
|
|
req.session = req.session || {};
|
|
|
req.session.authState = uuid.v4();
|
|
|
return passport.authenticate('wechat', {
|
|
|
state: req.session.authState
|
...
|
...
|
@@ -396,7 +397,6 @@ const wechat = { |
|
|
|
|
|
const sina = {
|
|
|
login: (req, res, next) => {
|
|
|
req.session = req.session || {};
|
|
|
req.session.authState = uuid.v4();
|
|
|
return passport.authenticate('sina', {
|
|
|
state: req.session.authState
|
...
|
...
|
@@ -426,8 +426,6 @@ const sina = { |
|
|
|
|
|
const qq = {
|
|
|
login: (req, res, next) => {
|
|
|
req.session = req.session || {};
|
|
|
|
|
|
let type = req.query.type || 'yohobuy';
|
|
|
let authState = req.session.authState = (req.query.state || uuid.v4()) + '::' + type;
|
|
|
|
...
|
...
|
@@ -489,7 +487,6 @@ const alipay = { |
|
|
|
|
|
const douban = {
|
|
|
login: (req, res, next) => {
|
|
|
req.session = req.session || {};
|
|
|
req.session.authState = uuid.v4();
|
|
|
return passport.authenticate('douban', {
|
|
|
state: req.session.authState
|
...
|
...
|
@@ -516,7 +513,6 @@ const douban = { |
|
|
|
|
|
const renren = {
|
|
|
login: (req, res, next) => {
|
|
|
req.session = req.session || {};
|
|
|
req.session.authState = uuid.v4();
|
|
|
return passport.authenticate('renren', {
|
|
|
state: req.session.authState
|
...
|
...
|
|