Skip to content

Commit

Permalink
Merge pull request #2 from ifeiteng/master
Browse files Browse the repository at this point in the history
only warn once when boot
  • Loading branch information
JacksonTian committed Dec 17, 2014
2 parents 8421aaa + 439f131 commit 8240603
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/oauth.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,10 @@ var OAuth = function (appid, appsecret, getToken, saveToken) {
this.getToken = getToken || function (openid, callback) {
callback(null, this.store[openid]);
};
if (!saveToken && process.env.NODE_ENV === 'production') {
console.warn('Please don\'t save oauth token into memory under production');
}
this.saveToken = saveToken || function (openid, token, callback) {
// 不建议在生产环境中使用它
if (process.env.NODE_ENV === 'production') {
console.warn('Please don\'t save token into memory under production');
}
this.store[openid] = token;
callback(null);
};
Expand Down

0 comments on commit 8240603

Please sign in to comment.