must verify your email before upgrading to premium

This commit is contained in:
Kyle Spearrin 2017-09-18 16:11:30 -04:00
parent 595cf6c375
commit 84a36a18d6
1 changed files with 10 additions and 2 deletions

View File

@ -7,8 +7,11 @@
, stripe
// @endif
) {
authService.getUserProfile().then(function (profile) {
if (profile.premium) {
var profile = null;
authService.getUserProfile().then(function (theProfile) {
profile = theProfile;
if (profile && profile.premium) {
return $state.go('backend.user.settingsBilling');
}
});
@ -63,6 +66,11 @@
$scope.submit = function (model, form) {
if ($scope.selfHosted) {
if (profile && !profile.emailVerified) {
validationService.addError(form, null, 'Your account\'s email address first must be verified.', true);
return;
}
var fileEl = document.getElementById('file');
var files = fileEl.files;
if (!files || !files.length) {