got account verification to work

This commit is contained in:
David Baldwynn 2015-07-28 17:16:44 -07:00
parent d8743555d5
commit 7fb5b73162
5 changed files with 9 additions and 6 deletions

View file

@ -15,8 +15,8 @@ module.exports = function(app) {
app.route('/users/accounts').delete(users.requiresLogin, users.removeOAuthProvider);
// Setting up the users account verification api
app.route('/auth/verify').post(users.resendVerificationEmail);
app.route('/auth/verify/:token').get(users.validateVerificationToken);
app.route('/auth/verify').post(users.resendVerificationEmail);
// Setting up the users password api
app.route('/users/password').post(users.requiresLogin, users.changePassword);

View file

@ -7,10 +7,13 @@ angular.module('users').controller('VerifyController', ['$scope', '$state', '$ro
}
$scope.isReset = false;
$scope.credentials = {};
// Submit forgotten password account id
$scope.resendVerifyEmail = function() {
User.resendVerifyEmail($scope.email).then(
console.log($scope.credentials.email);
User.resendVerifyEmail($scope.credentials.email).then(
function(response){
$scope.success = response.message;
$scope.credentials = null;

View file

@ -54,9 +54,9 @@ angular.module('users').factory('User', ['$window', '$q', '$timeout', '$http', '
return deferred.promise;
},
resendVerifyEmail: function(email) {
resendVerifyEmail: function(_email) {
var deferred = $q.defer();
$http.post('/auth/verify/', {email: email}).success(function(response) {
$http.post('/auth/verify/', {email: _email}).success(function(response) {
deferred.resolve(response);
}).error(function(error) {
deferred.reject(error.message || error);

View file

@ -29,7 +29,7 @@
<p>Before you continue, make sure to check your email for our verification. If you don't receive it within 24h drop us a line at <a href="mail:hi@medforms.com">hi@medforms.com</a></p>
<div class="text-center form-group">
<button type="submit" class="btn btn-large btn-primary">
<a href="/" style="color: white; text-decoration: none;">Continue</a>
<a href="/#!/" style="color: white; text-decoration: none;">Continue</a>
</button>
</div>
</div>

View file

@ -6,7 +6,7 @@
<form data-ng-submit="resendVerifyEmail()" class="signin form-horizontal" autocomplete="off">
<fieldset>
<div class="form-group">
<input type="text" id="username" name="email" class="form-control" data-ng-model="email" placeholder="bob@example.com">
<input type="text" id="username" name="email" class="form-control" data-ng-model="credentials.email" placeholder="bob@example.com">
</div>
<div class="text-center form-group">
<button type="submit" class="btn btn-primary" ng-click="resendVerifyEmail()">Submit</button>