Skip to content

Commit

Permalink
Add cookie secrets to env
Browse files Browse the repository at this point in the history
  • Loading branch information
Berkeley Martinez authored and Berkeley Martinez committed Jun 4, 2015
1 parent 02b1955 commit 72fe9c2
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 7 deletions.
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,25 +65,36 @@ Edit your .env file with the following API keys accordingly (if you only use ema
```
MONGOHQ_URL='mongodb://localhost:27017/freecodecamp'
BLOGGER_KEY=stuff
FACEBOOK_ID=stuff
FACEBOOK_SECRET=stuff
GITHUB_ID=stuff
GITHUB_SECRET=stuff
GOOGLE_ID=stuff
GOOGLE_SECRET=stuff
LINKEDIN_ID=stuff
LINKEDIN_SECRET=stuff
MANDRILL_PASSWORD=stuff
MANDRILL_USER=stuff
SESSION_SECRET=secretstuff
TRELLO_KEY=stuff
TRELLO_SECRET=stuff
TWITTER_KEY=stuff
TWITTER_SECRET=stuff
TWITTER_TOKEN=stuff
TWITTER_TOKEN_SECRET=stuff
BLOGGER_KEY=stuff
SLACK_WEBHOOK=stuff
SESSION_SECRET=secretstuff
COOKIE_SECRET='this is a secret'
PEER=stuff
DEBUG=true
Expand Down
10 changes: 6 additions & 4 deletions config/secrets.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ module.exports = {
},

twitter: {
consumerKey: process.env.TWITTER_KEY,
consumerSecret: process.env.TWITTER_SECRET,
token: process.env.TWITTER_TOKEN,
tokenSecret: process.env.TWITTER_TOKEN_SECRET,
consumerKey: process.env.TWITTER_KEY,
consumerSecret: process.env.TWITTER_SECRET,
token: process.env.TWITTER_TOKEN,
tokenSecret: process.env.TWITTER_TOKEN_SECRET,
callbackURL: '/auth/twitter/callback',
passReqToCallback: true
},
Expand All @@ -60,4 +60,6 @@ module.exports = {
passReqToCallback: true
},
slackHook: process.env.SLACK_WEBHOOK,

cookieSecret: process.env.COOKIE_SECRET
};
2 changes: 1 addition & 1 deletion server/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ app.use(expressValidator({
}
}));
app.use(methodOverride());
app.use(cookieParser());
app.use(cookieParser(secrets.cookieSecret));
app.use(session({
resave: true,
saveUninitialized: true,
Expand Down

0 comments on commit 72fe9c2

Please sign in to comment.