Fixes
This commit is contained in:
parent
08a9eae2d3
commit
df62ee8d58
|
@ -34,6 +34,10 @@ function handleAuth(socket, accept) {
|
||||||
if (data.headers.cookie) {
|
if (data.headers.cookie) {
|
||||||
cookieParser(data, null, function () {
|
cookieParser(data, null, function () {
|
||||||
var auth = data.signedCookies.auth;
|
var auth = data.signedCookies.auth;
|
||||||
|
if (!auth) {
|
||||||
|
return accept(null, true);
|
||||||
|
}
|
||||||
|
|
||||||
session.verifySession(auth, function (err, user) {
|
session.verifySession(auth, function (err, user) {
|
||||||
if (!err) {
|
if (!err) {
|
||||||
socket.user = {
|
socket.user = {
|
||||||
|
|
|
@ -21,6 +21,10 @@ exports.genSession = function (account, expiration, cb) {
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.verifySession = function (input, cb) {
|
exports.verifySession = function (input, cb) {
|
||||||
|
if (typeof input !== "string") {
|
||||||
|
return cb("Invalid auth string");
|
||||||
|
}
|
||||||
|
|
||||||
var parts = input.split(":");
|
var parts = input.split(":");
|
||||||
if (parts.length !== 4) {
|
if (parts.length !== 4) {
|
||||||
return cb("Invalid auth string");
|
return cb("Invalid auth string");
|
||||||
|
|
|
@ -27,7 +27,7 @@ function handleLogin(req, res) {
|
||||||
dest = dest.match(/login|logout/) ? null : dest;
|
dest = dest.match(/login|logout/) ? null : dest;
|
||||||
|
|
||||||
if (typeof name !== "string" || typeof password !== "string") {
|
if (typeof name !== "string" || typeof password !== "string") {
|
||||||
res.send(400);
|
res.sendStatus(400);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ function handleLogin(req, res) {
|
||||||
if (host.indexOf(Config.get("http.root-domain")) === -1 &&
|
if (host.indexOf(Config.get("http.root-domain")) === -1 &&
|
||||||
Config.get("http.alt-domains").indexOf(host) === -1) {
|
Config.get("http.alt-domains").indexOf(host) === -1) {
|
||||||
Logger.syslog.log("WARNING: Attempted login from non-approved domain " + host);
|
Logger.syslog.log("WARNING: Attempted login from non-approved domain " + host);
|
||||||
return res.send(403);
|
return res.sendStatus(403);
|
||||||
}
|
}
|
||||||
|
|
||||||
var expiration;
|
var expiration;
|
||||||
|
@ -166,7 +166,7 @@ function handleRegister(req, res) {
|
||||||
var ip = webserver.ipForRequest(req);
|
var ip = webserver.ipForRequest(req);
|
||||||
|
|
||||||
if (typeof name !== "string" || typeof password !== "string") {
|
if (typeof name !== "string" || typeof password !== "string") {
|
||||||
res.send(400);
|
res.sendStatus(400);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,7 @@ mixin navloginform(redirect)
|
||||||
.checkbox
|
.checkbox
|
||||||
label
|
label
|
||||||
input(type="checkbox", name="remember")
|
input(type="checkbox", name="remember")
|
||||||
| Remember me
|
span.navbar-text-nofloat Remember me
|
||||||
button#login.btn.btn-default(type="submit") Login
|
button#login.btn.btn-default(type="submit") Login
|
||||||
.visible-md
|
.visible-md
|
||||||
p#loginform.navbar-text.pull-right
|
p#loginform.navbar-text.pull-right
|
||||||
|
|
4
www/css/themes/bootstrap-theme.min.css
vendored
4
www/css/themes/bootstrap-theme.min.css
vendored
|
@ -69,3 +69,7 @@ footer {
|
||||||
.queue_entry.queue_active {
|
.queue_entry.queue_active {
|
||||||
background-color: #d9edf7;
|
background-color: #d9edf7;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.navbar-inverse .navbar-text-nofloat {
|
||||||
|
color: #9d9d9d;
|
||||||
|
}
|
||||||
|
|
|
@ -81,3 +81,7 @@ input.form-control[type="email"], textarea.form-control {
|
||||||
.queue_entry.queue_active {
|
.queue_entry.queue_active {
|
||||||
background-color: #333333;
|
background-color: #333333;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.navbar-inverse .navbar-text-nofloat {
|
||||||
|
color: #888;
|
||||||
|
}
|
||||||
|
|
|
@ -63,3 +63,7 @@ footer {
|
||||||
.queue_entry.queue_active {
|
.queue_entry.queue_active {
|
||||||
background-color: #d9edf7;
|
background-color: #d9edf7;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.navbar-inverse .navbar-text-nofloat {
|
||||||
|
color: #9d9d9d;
|
||||||
|
}
|
||||||
|
|
|
@ -169,3 +169,7 @@ input.form-control[type="email"], textarea.form-control {
|
||||||
#newpollbtn {
|
#newpollbtn {
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.navbar-inverse .navbar-text-nofloat {
|
||||||
|
color: #c8c8c8;
|
||||||
|
}
|
||||||
|
|
|
@ -93,3 +93,7 @@ input.form-control[type="email"], textarea.form-control {
|
||||||
border-color: #aaaaaa;
|
border-color: #aaaaaa;
|
||||||
background-color: #272b30;
|
background-color: #272b30;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.navbar-inverse .navbar-text-nofloat {
|
||||||
|
color: #ccc;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue