mirror of https://github.com/calzoneman/sync.git
Fix registration
This commit is contained in:
parent
b5812081b8
commit
423c787ccb
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue