Commit d02b4a35 authored by NGPixel's avatar NGPixel

Fixed search not working for guests in public mode

parent 642bcac4
...@@ -16,8 +16,10 @@ This project adheres to [Semantic Versioning](http://semver.org/). ...@@ -16,8 +16,10 @@ This project adheres to [Semantic Versioning](http://semver.org/).
### Fixed ### Fixed
- **Configuration Wizard**: Git version detection no longer fails on MacOS - **Configuration Wizard**: Git version detection no longer fails on MacOS
- **Init**: Malformed config file is now being reported correctly - **Init**: Malformed config file is now being reported correctly
- **UI**: Scrollbar is no longer always shown in code blocks - **Init**: Git remote is now always updated to current settings
- **Misc**: CJK (Chinese, Japanese & Korean) characters are now fully supported for pages, content and uploads - **Misc**: CJK (Chinese, Japanese & Korean) characters are now fully supported for pages, content and uploads
- **UI**: Scrollbar is no longer always shown in code blocks
- **Search**: Search is now working for guest users when public mode is enabled
## [v1.0.0-beta.10] - 2017-04-08 ## [v1.0.0-beta.10] - 2017-04-08
### Added ### Added
......
...@@ -5,25 +5,24 @@ ...@@ -5,25 +5,24 @@
const _ = require('lodash') const _ = require('lodash')
module.exports = (socket) => { module.exports = (socket) => {
if (!socket.request.user.logged_in) {
return
}
// ----------------------------------------- // -----------------------------------------
// SEARCH // SEARCH
// ----------------------------------------- // -----------------------------------------
if (appconfig.public || socket.request.user.logged_in) {
socket.on('search', (data, cb) => { socket.on('search', (data, cb) => {
cb = cb || _.noop cb = cb || _.noop
search.find(data.terms).then((results) => { search.find(data.terms).then((results) => {
return cb(results) || true return cb(results) || true
}) })
}) })
}
// ----------------------------------------- // -----------------------------------------
// UPLOADS // UPLOADS
// ----------------------------------------- // -----------------------------------------
if (socket.request.user.logged_in) {
socket.on('uploadsGetFolders', (data, cb) => { socket.on('uploadsGetFolders', (data, cb) => {
cb = cb || _.noop cb = cb || _.noop
upl.getUploadsFolders().then((f) => { upl.getUploadsFolders().then((f) => {
...@@ -94,4 +93,5 @@ module.exports = (socket) => { ...@@ -94,4 +93,5 @@ module.exports = (socket) => {
}) || true }) || true
}) })
}) })
}
} }
...@@ -18,8 +18,6 @@ html ...@@ -18,8 +18,6 @@ html
link(rel='manifest', href='/manifest.json') link(rel='manifest', href='/manifest.json')
// JS / CSS // JS / CSS
//script(type='text/javascript').
script(type='text/javascript', src='/js/bundle.min.js') script(type='text/javascript', src='/js/bundle.min.js')
block head block head
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment