|
@@ -63,8 +63,8 @@ module.exports = {
|
|
|
|
|
|
},
|
|
|
|
|
|
- register: (session, username, email, password, recaptcha, cb) => {
|
|
|
-
|
|
|
+ register: function(session, username, email, password, recaptcha, cb) {
|
|
|
+ let _this = this;
|
|
|
async.waterfall([
|
|
|
|
|
|
// verify the request with google recaptcha
|
|
@@ -134,7 +134,13 @@ module.exports = {
|
|
|
return cb({ status: 'error', message: 'An error occurred while registering for an account' });
|
|
|
}
|
|
|
// respond with the payload that was passed to us earlier
|
|
|
- cb(payload);
|
|
|
+ _this.login(session, email, password, (result) => {
|
|
|
+ let obj = { status: 'success', message: 'Successfully registered.' };
|
|
|
+ if (result.status === 'success') {
|
|
|
+ obj.SID = result.SID;
|
|
|
+ }
|
|
|
+ cb(obj);
|
|
|
+ });
|
|
|
});
|
|
|
|
|
|
},
|