make clipper api authenticated for server and unauthenticated for local electron

This commit is contained in:
zadam
2019-07-07 13:12:40 +02:00
parent 95a773e5c9
commit 7d57961ab2
3 changed files with 28 additions and 14 deletions

View File

@@ -7,6 +7,7 @@ const imageService = require('../../services/image');
const appInfo = require('../../services/app_info');
const messagingService = require('../../services/messaging');
const log = require('../../services/log');
const utils = require('../../services/utils');
const path = require('path');
const Link = require('../../entities/link');
@@ -144,12 +145,21 @@ async function createImage(req) {
}
async function openNote(req) {
messagingService.sendMessageToAllClients({
type: 'open-note',
noteId: req.params.noteId
});
if (utils.isElectron()) {
messagingService.sendMessageToAllClients({
type: 'open-note',
noteId: req.params.noteId
});
return {};
return {
result: 'ok'
};
}
else {
return {
result: 'open-in-browser'
}
}
}
async function handshake() {