Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

fix: fetch workspace iam policy (#12870)

ecmadao240ed11ce438
diff --git a/frontend/src/App.vue b/frontend/src/App.vue
index 0629ace8a0..b82c47dbbd 100644
--- a/frontend/src/App.vue
+++ b/frontend/src/App.vue
@@ -52,7 +52,6 @@ import OverlayStackManager from "./components/misc/OverlayStackManager.vue";
import { t } from "./plugins/i18n";
import { AUTH_SIGNIN_MODULE } from "./router/auth";
import {
- useWorkspaceV1Store,
useActuatorV1Store,
useAuthStore,
useNotificationStore,
@@ -85,7 +84,6 @@ onMounted(async () => {
await useSubscriptionV1Store().fetchFeatureMatrix();
};
const restoreUser = async () => {
- await useWorkspaceV1Store().fetchIamPolicy();
await authStore.restoreUser();
};
const initBasicModules = async () => {
diff --git a/frontend/src/store/modules/auth.ts b/frontend/src/store/modules/auth.ts
index d9802da049..841ef96c65 100644
--- a/frontend/src/store/modules/auth.ts
+++ b/frontend/src/store/modules/auth.ts
@@ -13,6 +13,7 @@ import type {
import { UserType } from "@/types/proto/v1/auth_service";
import { getIntCookie } from "@/utils";
import { useUserStore } from ".";
+import { useWorkspaceV1Store } from "./v1/workspace";
interface AuthState {
currentUser: ComposedUser;
@@ -36,6 +37,7 @@ export const useAuthStore = defineStore("auth_v1", {
const userId = getIntCookie("user");
if (userId) {
+ await useWorkspaceV1Store().fetchIamPolicy();
const loggedInUser = await useUserStore().getOrFetchUserById(
String(userId)
);
@@ -74,6 +76,7 @@ export const useAuthStore = defineStore("auth_v1", {
).data.data;
// Refresh the corresponding user.
+ await useWorkspaceV1Store().fetchIamPolicy();
const user = await useUserStore().getOrFetchUserById(
String(activatedUser.id)
);
@@ -83,6 +86,7 @@ export const useAuthStore = defineStore("auth_v1", {
async restoreUser() {
const userId = getIntCookie("user");
if (userId) {
+ await useWorkspaceV1Store().fetchIamPolicy();
const loggedInUser = await useUserStore().getOrFetchUserById(
String(userId),
true // silent