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) {
|
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,
|
||||||
|
|
Loading…
Reference in New Issue