mirror of
https://github.com/spacedeck/spacedeck-open.git
synced 2025-12-15 09:27:31 +01:00
Allow providing auth session token via HTTP header
This commit is contained in:
@@ -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 } })
|
||||
|
||||
Reference in New Issue
Block a user