Fix registration

This commit is contained in:
calzoneman 2013-12-25 22:30:24 -05:00
parent b5812081b8
commit 423c787ccb
1 changed files with 5 additions and 10 deletions

View File

@ -30,8 +30,8 @@ function handleLogin(req, res) {
db.users.verifyLogin(name, password, function (err, user) { db.users.verifyLogin(name, password, function (err, user) {
if (err) { if (err) {
if (err === 'Invalid username/password combination') { if (err === 'Invalid username/password combination') {
Logger.eventlog('Login failed (bad password): ' + name Logger.syslog.log('Login failed (bad password): ' + name
+ '@' + webserver.ipForRequest(req)); + '@' + webserver.ipForRequest(req));
} }
sendJade(res, 'login', { sendJade(res, 'login', {
loggedIn: false, loggedIn: false,
@ -141,19 +141,14 @@ function handleRegister(req, res) {
return; return;
} }
db.users.register({ db.users.register(name, password, email, ip, function (err) {
name: name,
password: password,
email: email,
ip: ip
}, function (err) {
if (err) { if (err) {
sendJade(res, 'register', { sendJade(res, 'register', {
registerError: err registerError: err
}); });
} else { } else {
Logger.eventlog(ip + ' registered account: ' + name + Logger.syslog.log(ip + ' registered account: ' + name +
(email.length > 0 ? ' <' + email + '>' : '')); (email.length > 0 ? ' <' + email + '>' : ''));
sendJade(res, 'register', { sendJade(res, 'register', {
registered: true, registered: true,
registerName: name, registerName: name,