mirror of
https://github.com/zadam/trilium.git
synced 2025-11-01 19:05:59 +01:00
fixes for sync
This commit is contained in:
@@ -6,8 +6,7 @@ async function checkAuth(req, res, next) {
|
||||
if (!req.session.loggedIn) {
|
||||
res.redirect("login");
|
||||
}
|
||||
|
||||
if (await migration.isDbUpToDate()) {
|
||||
else if (await migration.isDbUpToDate()) {
|
||||
next();
|
||||
}
|
||||
else {
|
||||
@@ -26,20 +25,19 @@ async function checkAuthWithoutMigration(req, res, next) {
|
||||
|
||||
async function checkApiAuth(req, res, next) {
|
||||
if (!req.session.loggedIn) {
|
||||
res.sendStatus(401);
|
||||
res.status(401).send({});
|
||||
}
|
||||
|
||||
if (await migration.isDbUpToDate()) {
|
||||
else if (await migration.isDbUpToDate()) {
|
||||
next();
|
||||
}
|
||||
else {
|
||||
res.sendStatus(409); // need better response than that
|
||||
res.status(409).send({}); // need better response than that
|
||||
}
|
||||
}
|
||||
|
||||
async function checkApiAuthWithoutMigration(req, res, next) {
|
||||
if (!req.session.loggedIn) {
|
||||
res.sendStatus(401);
|
||||
res.status(401).send({});
|
||||
}
|
||||
else {
|
||||
next();
|
||||
|
||||
Reference in New Issue
Block a user