We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 05dd6eb commit db615e5Copy full SHA for db615e5
lib/note/index.js
@@ -94,14 +94,14 @@ async function showPublishNote (req, res) {
94
includeUser: true
95
})
96
97
- if (!canViewNote(note, req.isAuthenticated(), req.user ? req.user.id : null)) {
98
- return errorForbidden(req)
99
- }
100
-
101
if (!note) {
102
return errorNotFound(res)
103
}
104
+ if (!canViewNote(note, req.isAuthenticated(), req.user ? req.user.id : null)) {
+ return errorForbidden(req)
+ }
+
105
if ((note.alias && shortid !== note.alias) || (!note.alias && shortid !== note.shortid)) {
106
return res.redirect(config.serverURL + '/s/' + (note.alias || note.shortid))
107
0 commit comments