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