Only auto-login the owner for subscription setup

This commit is contained in:
Johannes Zellner
2020-02-24 15:10:21 +01:00
parent 4b1cb76eaf
commit a17d810fea

View File

@@ -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;
});