Skip to content

Commit bcd92f5

Browse files
committed
return errorForbidden when anonymous user tries to create freeUrl pad (closes #1499)
Signed-off-by: Lucas Druschke <[email protected]>
1 parent 4fd6293 commit bcd92f5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/note/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ async function showNote (req, res) {
6161
// if allow free url enable, auto create note
6262
if (!config.allowFreeURL || config.forbiddenNoteIDs.includes(noteId)) {
6363
return errorNotFound(req, res)
64+
} else if (!config.allowAnonymous && !userId) {
65+
return errorForbidden(req, res)
6466
}
6567
note = await createNote(userId, noteId)
6668
}

0 commit comments

Comments
 (0)