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) {
if (err) {
if (err === 'Invalid username/password combination') {
Logger.eventlog('Login failed (bad password): ' + name
+ '@' + webserver.ipForRequest(req));
Logger.syslog.log('Login failed (bad password): ' + name
+ '@' + webserver.ipForRequest(req));
}
sendJade(res, 'login', {
loggedIn: false,
@ -141,19 +141,14 @@ 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 +
(email.length > 0 ? ' <' + email + '>' : ''));
Logger.syslog.log(ip + ' registered account: ' + name +
(email.length > 0 ? ' <' + email + '>' : ''));
sendJade(res, 'register', {
registered: true,
registerName: name,