removed dataKey where it's not necessary anymore (use of CLS instead)

This commit is contained in:
azivner
2018-03-31 08:53:52 -04:00
parent 5d203b2278
commit 05676f3459
12 changed files with 78 additions and 105 deletions

View File

@@ -20,7 +20,7 @@ async function getNote(req) {
return [404, "Note " + noteId + " has not been found."];
}
protected_session.decryptNote(req, note);
protected_session.decryptNote(note);
if (note.type === 'file') {
// no need to transfer (potentially large) file payload for this request
@@ -46,24 +46,21 @@ async function createNote(req) {
async function updateNote(req) {
const note = req.body;
const noteId = req.params.noteId;
const dataKey = protected_session.getDataKey(req);
await notes.updateNote(noteId, note, dataKey);
await notes.updateNote(noteId, note);
}
async function sortNotes(req) {
const noteId = req.params.noteId;
const dataKey = protected_session.getDataKey(req);
await tree.sortNotesAlphabetically(noteId, dataKey);
await tree.sortNotesAlphabetically(noteId);
}
async function protectBranch(req) {
const noteId = req.params.noteId;
const isProtected = !!parseInt(req.params.isProtected);
const dataKey = protected_session.getDataKey(req);
await notes.protectNoteRecursively(noteId, dataKey, isProtected);
await notes.protectNoteRecursively(noteId, isProtected);
}
async function setNoteTypeMime(req) {