Skip to content

Commit

Permalink
Merge pull request #26 from timothyarmes/verify-email-bug
Browse files Browse the repository at this point in the history
Accounts.verifyEmail should not be called on the server.
  • Loading branch information
splendido committed Jan 8, 2016
2 parents 2d98f3c + 74709a2 commit 9b8bfeb
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions lib/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,6 @@ AccountsTemplates.configureRoute = function(route, options) {
}

layoutRegions[contentRegion] = React.createElement(BlazeToReact, { blazeTemplate: template });

}

function doLayout() {
Expand Down Expand Up @@ -226,12 +225,14 @@ AccountsTemplates.configureRoute = function(route, options) {
doLayout();

var token = params.paramToken;
Accounts.verifyEmail(token, function(error) {
AccountsTemplates.setDisabled(false);
AccountsTemplates.submitCallback(error, route, function() {
AccountsTemplates.state.form.set("result", AccountsTemplates.texts.info.emailVerified);
});
});
if (Meteor.isClient) {
Accounts.verifyEmail(token, function(error) {
AccountsTemplates.setDisabled(false);
AccountsTemplates.submitCallback(error, route, function() {
AccountsTemplates.state.form.set("result", AccountsTemplates.texts.info.emailVerified);
});
});
}
}
});
} else {
Expand Down

0 comments on commit 9b8bfeb

Please sign in to comment.