Minor fixes

This commit is contained in:
calzoneman 2015-11-02 20:52:57 -08:00
parent 6505aa2f5e
commit 5c339656b7
3 changed files with 4 additions and 2 deletions

View File

@ -127,7 +127,7 @@ function handleLogout(req, res) {
res.clearCookie("auth"); res.clearCookie("auth");
req.user = res.user = null; req.user = res.user = null;
// Try to find an appropriate redirect // Try to find an appropriate redirect
var dest = req.params.dest || req.header("referer"); var dest = req.body.dest || req.header("referer");
dest = dest && dest.match(/login|logout|account/) ? null : dest; dest = dest && dest.match(/login|logout|account/) ? null : dest;
var host = req.hostname; var host = req.hostname;

View File

@ -8,7 +8,7 @@ export default function initialize(app, ioConfig) {
app.get('/r/:channel', (req, res) => { app.get('/r/:channel', (req, res) => {
if (!req.params.channel || !CyTubeUtil.isValidChannelName(req.params.channel)) { if (!req.params.channel || !CyTubeUtil.isValidChannelName(req.params.channel)) {
throw new HTTPError(`"${sanitizeText(req.params.channel)}" is not a valid ` + throw new HTTPError(`"${sanitizeText(req.params.channel)}" is not a valid ` +
'channel name.', { status: HTTPStatus.BAD_REQUEST }); 'channel name.', { status: HTTPStatus.NOT_FOUND });
} }
const endpoints = ioConfig.getSocketEndpoints(); const endpoints = ioConfig.getSocketEndpoints();

View File

@ -1,6 +1,8 @@
mixin notfound() mixin notfound()
h1 Not Found h1 Not Found
p The page you were looking for doesn't seem to exist. Please check that you typed the URL correctly. p The page you were looking for doesn't seem to exist. Please check that you typed the URL correctly.
if message
p Reason: #{message}
mixin forbidden() mixin forbidden()
h1 Forbidden h1 Forbidden
p You don't have permission to access <code>#{path}</code> p You don't have permission to access <code>#{path}</code>