Merge pull request #1500 from ldruschk/fix-internal-server-error-freeurl-not-logged-in

return errorForbidden when anonymous user tries to create freeUrl pad
This commit is contained in:
Raccoon 2020-05-11 16:05:20 +08:00 committed by GitHub
commit a6c7582aa2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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)
}