got account verification to work
This commit is contained in:
parent
d8743555d5
commit
7fb5b73162
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue