API auth (untested)

This commit is contained in:
azivner
2017-10-28 22:17:00 -04:00
parent eb6f9f8f81
commit c28b7775a5
4 changed files with 73 additions and 15 deletions

View File

@@ -25,7 +25,7 @@ async function checkAuthWithoutMigration(req, res, next) {
}
async function checkApiAuth(req, res, next) {
if (!req.session.loggedIn && req.header("auth") !== "sync") {
if (!req.session.loggedIn) {
res.sendStatus(401);
}
@@ -38,7 +38,7 @@ async function checkApiAuth(req, res, next) {
}
async function checkApiAuthWithoutMigration(req, res, next) {
if (!req.session.loggedIn && req.header("auth") !== "sync") {
if (!req.session.loggedIn) {
res.sendStatus(401);
}
else {