Remove global CORS for api endpoints and setup temp CORS check for ebook endpoint

This commit is contained in:
advplyr 2023-11-19 11:32:48 -06:00
parent 56c574c928
commit 4c2c320b9d
2 changed files with 27 additions and 15 deletions

View file

@ -17,18 +17,6 @@ class Auth {
constructor() {
}
static cors(req, res, next) {
res.header('Access-Control-Allow-Origin', '*')
res.header("Access-Control-Allow-Methods", 'GET, POST, PATCH, PUT, DELETE, OPTIONS')
res.header('Access-Control-Allow-Headers', '*')
res.header('Access-Control-Allow-Credentials', true)
if (req.method === 'OPTIONS') {
res.sendStatus(200)
} else {
next()
}
}
/**
* Inializes all passportjs strategies and other passportjs ralated initialization.
*/