mirror of
https://github.com/skooner-k8s/skooner.git
synced 2026-02-14 17:49:55 +00:00
Fixing issue where auth cookie is being sent w/ every response
This commit is contained in:
@@ -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.');
|
||||
|
||||
Reference in New Issue
Block a user