diff --git a/src/js/client.js b/src/js/client.js index 5be914535..e79b32dc6 100644 --- a/src/js/client.js +++ b/src/js/client.js @@ -2236,12 +2236,13 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout Client.prototype.openSubscriptionSetup = function (subscription) { var that = this; - this.getAppstoreUserToken(function (error, result) { - if (error) return console.error('Unable to get appstore user token.', error); + var email = subscription.emailEncoded; + var cloudronId = subscription.cloudronId; - var token = result; - var email = subscription.emailEncoded; - var cloudronId = subscription.cloudronId; + if (!this._userInfo.isAtLeastOwner) return window.location.href = that.getConfig().webServerOrigin + '/console.html#/userprofile?view=subscriptions&email=' + email + '&cloudronId=' + cloudronId; + + this.getAppstoreUserToken(function (error, token) { + if (error) console.error('Unable to get appstore user token.', error); window.location.href = that.getConfig().webServerOrigin + '/console.html#/userprofile?view=subscriptions&email=' + email + '&cloudronId=' + cloudronId + '&token=' + token; });