Fixing issue where auth cookie is being sent w/ every response

This commit is contained in:
Eric Herbrandson
2020-08-19 14:08:35 -05:00
parent 1e15acfdf1
commit 539b6b2b71
2 changed files with 795 additions and 795 deletions

View File

@@ -61,7 +61,7 @@ function preAuth(req, res, next) {
const auth = req.header('Authorization');
// If the request already contains an authorization header, pass it through to the client (as a cookie)
if (auth) {
if (auth && req.method === 'GET' && req.path === '/') {
const value = auth.replace('Bearer ', '');
res.cookie('Authorization', value, {maxAge: 60, httpOnly: false});
console.log('Authorization header found. Passing through to client.');