Merge pull request #238 from medienhaus/mnt

Allow providing auth session token via HTTP header
This commit is contained in:
Florian Weber
2022-04-28 11:18:48 +02:00
committed by GitHub

View File

@@ -23,7 +23,12 @@ module.exports = (req, res, next) => {
}
// authentication via session/cookie
const token = req.cookies["sdsession"];
let token = req.cookies["sdsession"];
if (!token || token == null) {
// authentication via session/header
token = req.headers["x-spacedeck-auth"];
}
if (token && token != "null" && token != null) {
db.Session.findOne({ where: { token: token } })