Skip to content

Commit

Permalink
Edit cookie configs dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaisa Korpela committed Oct 26, 2020
1 parent bf64940 commit f94bd34
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@ const router = express.Router()
const clientUrl = process.env.CLIENT_URL || 'http://localhost:3000'

const cookieConfig = {
maxAge: 24 * 60 * 60 * 1000, // 24 hours
sameSite: 'none',
secure: clientUrl === 'http://localhost:3000' ? false : true,
maxAge: 24 * 60 * 60 * 1000,
}
if (process.env.NODE_ENV !== 'development') {
cookieConfig.sameSite = 'none'
cookieConfig.secure = true
}

const main = async () => {
Expand Down

0 comments on commit f94bd34

Please sign in to comment.