return errorForbidden when anonymous user tries to create freeUrl pad (closes #1499)

Signed-off-by: Lucas Druschke <ldruschk@posteo.de>
This commit is contained in:
Lucas Druschke 2020-04-29 22:40:46 +02:00
parent 4fd6293963
commit bcd92f500f
1 changed files with 2 additions and 0 deletions

View File

@ -61,6 +61,8 @@ async function showNote (req, res) {
// if allow free url enable, auto create note
if (!config.allowFreeURL || config.forbiddenNoteIDs.includes(noteId)) {
return errorNotFound(req, res)
} else if (!config.allowAnonymous && !userId) {
return errorForbidden(req, res)
}
note = await createNote(userId, noteId)
}