mirror of
https://github.com/zadam/trilium.git
synced 2025-11-01 19:05:59 +01:00
make clipper api authenticated for server and unauthenticated for local electron
This commit is contained in:
@@ -56,7 +56,7 @@ async function checkAppNotInitialized(req, res, next) {
|
||||
}
|
||||
}
|
||||
|
||||
async function checkSenderToken(req, res, next) {
|
||||
async function checkToken(req, res, next) {
|
||||
const token = req.headers.authorization;
|
||||
|
||||
if (await sql.getValue("SELECT COUNT(*) FROM api_tokens WHERE isDeleted = 0 AND token = ?", [token]) === 0) {
|
||||
@@ -89,6 +89,6 @@ module.exports = {
|
||||
checkAppInitialized,
|
||||
checkAppNotInitialized,
|
||||
checkApiAuthOrElectron,
|
||||
checkSenderToken,
|
||||
checkToken,
|
||||
checkBasicAuth
|
||||
};
|
||||
Reference in New Issue
Block a user