fix(editor): Fix Admin panel icon in the sidebar for cloud deployments (no-changelog) (#7738)

Co-authored-by: ricardo <ricardoespinoza105@gmail.com>
Co-authored-by: Mutasem Aldmour <mutasem@n8n.io>
This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2023-11-17 14:44:47 +01:00
committed by GitHub
parent b66b8c18e9
commit 2d039010db
10 changed files with 41 additions and 77 deletions

View File

@@ -151,6 +151,12 @@ export const useCloudPlanStore = defineStore(STORES.CLOUD_PLAN, () => {
} catch {}
};
const redirectToDashboard = async () => {
const adminPanelHost = new URL(window.location.href).host.split('.').slice(1).join('.');
const { code } = await getAutoLoginCode();
window.location.href = `https://${adminPanelHost}/login?code=${code}`;
};
return {
state,
getOwnerCurrentPlan,
@@ -166,5 +172,6 @@ export const useCloudPlanStore = defineStore(STORES.CLOUD_PLAN, () => {
checkForCloudPlanData,
fetchUserCloudAccount,
getAutoLoginCode,
redirectToDashboard,
};
});