Skip to content

Commit

Permalink
Fix auth on tenant change (#1043)
Browse files Browse the repository at this point in the history
  • Loading branch information
joanagmaia authored Jun 27, 2023
1 parent 7703c1b commit 4018f94
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion frontend/src/modules/dashboard/pages/dashboard-page.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@

<script setup>
import {
onMounted, onBeforeUnmount, ref, computed,
onMounted, onBeforeUnmount, ref, computed, watch,
} from 'vue';
import { useStore } from 'vuex';
import AppDashboardIntegrations from '@/modules/dashboard/components/dashboard-active-integrations.vue';
Expand Down Expand Up @@ -115,6 +115,15 @@ onMounted(() => {
onBeforeUnmount(() => {
storeUnsubscribe.value();
});
watch(currentTenant, (updatedTenant, previousTenant) => {
if (updatedTenant.id !== previousTenant.id) {
getCubeToken();
}
}, {
deep: true,
immediate: true,
});
</script>

<style lang="scss" scoped>
Expand Down

0 comments on commit 4018f94

Please sign in to comment.