diff --git a/app.js b/app.js index a0ebe0f16..b4f23e03f 100644 --- a/app.js +++ b/app.js @@ -7,7 +7,6 @@ var express = require('express'); var bodyParser = require('body-parser'); var methodOverride = require('method-override'); var morgan = require('morgan'); -var cookieParser = require('cookie-parser'); var mongoose = require('mongoose'); var port = process.env.PORT || 3000; @@ -22,7 +21,6 @@ var app = express(); mongoose.connect(database); app.use(morgan('dev')); -app.use(cookieParser()); app.use(bodyParser.urlencoded({ extended: true diff --git a/app/client/src/routes.js b/app/client/src/routes.js index 402bf1fdc..4619e9540 100644 --- a/app/client/src/routes.js +++ b/app/client/src/routes.js @@ -63,6 +63,9 @@ angular.module('reg') url: "/application", templateUrl: "views/application/application.html", controller: 'ApplicationCtrl', + data: { + requireVerified: true + }, resolve: { currentUser: function(UserService){ return UserService.getCurrentUser(); diff --git a/app/server/controllers/UserController.js b/app/server/controllers/UserController.js index 4dac18817..38ec5717b 100644 --- a/app/server/controllers/UserController.js +++ b/app/server/controllers/UserController.js @@ -406,7 +406,7 @@ UserController.declineById = function (id, callback){ UserController.verifyByToken = function(token, callback){ User.verifyEmailVerificationToken(token, function(err, email){ User.findOneAndUpdate({ - email: new RegExp('^' + email + '$', 'i') + email: email.toLowerCase() },{ $set: { 'verified': true @@ -715,4 +715,4 @@ UserController.getStats = function(callback){ return callback(null, Stats.getUserStats()); }; -module.exports = UserController; \ No newline at end of file +module.exports = UserController; diff --git a/app/server/models/User.js b/app/server/models/User.js index bc8d4eb94..4cc5d86bc 100644 --- a/app/server/models/User.js +++ b/app/server/models/User.js @@ -309,7 +309,7 @@ schema.statics.verifyTempAuthToken = function(token, callback){ schema.statics.findOneByEmail = function(email){ return this.findOne({ - email: new RegExp('^' + email + '$', 'i') + email: email.toLowerCase() }); }; diff --git a/package.json b/package.json index 8c2ba41b5..4358af629 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,6 @@ "bcrypt-nodejs": "0.0.3", "body-parser": "^1.8.4", "bower": "^1.8.0", - "cookie-parser": "~1.3.2", "dotenv": "^1.2.0", "email-templates": "^2.0.1", "express": "^4.9.8", @@ -20,7 +19,7 @@ "gulp-sass": "^2.3.2", "gulp-sourcemaps": "^1.12.0", "gulp-uglify": "^1.5.4", - "handlebars": "^3.0.3", + "handlebars": "^4.0.11", "jsonwebtoken": "5.0.4", "method-override": "^2.3.5", "moment": "^2.10.3",