Browse Source

Fixed issues with login/register.

KrisVos130 8 years ago
parent
commit
bcd7142206
2 changed files with 8 additions and 9 deletions
  1. 1 2
      backend/logic/actions/users.js
  2. 7 7
      frontend/App.vue

+ 1 - 2
backend/logic/actions/users.js

@@ -64,7 +64,6 @@ module.exports = {
 	},
 
 	register: function(session, username, email, password, recaptcha, cb) {
-		let _this = this;
 		async.waterfall([
 
 			// verify the request with google recaptcha
@@ -134,7 +133,7 @@ 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
-			_this.login(session, email, password, (result) => {
+			module.exports.login(session, email, password, (result) => {
 				let obj = { status: 'success', message: 'Successfully registered.' };
 				if (result.status === 'success') {
 					obj.SID = result.SID;

+ 7 - 7
frontend/App.vue

@@ -46,7 +46,13 @@
 						Toast.methods.addToast(result.message, 4000);
 					}
 				});
-			}
+			},
+			'submitOnEnter': function(cb, event){
+				if (event.which == 13) {
+					cb();
+					return false;
+				}
+			},
 		},
 		ready() {
 			let _this = this;
@@ -58,12 +64,6 @@
 			});
 		},
 		events: {
-			'submitOnEnter': function(cb, event){
-				if (event.which == 13) {
-					cb();
-					return false;
-				}
-			},
 			'register': function () {
 				let { register: { email, username, password } } = this;
 				let _this = this;