Skip to content

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

chore: fix create user params (#10208)

boojackcc0d62b249ba
diff --git a/frontend/src/components/User/Settings/CreateUserDrawer.vue b/frontend/src/components/User/Settings/CreateUserDrawer.vue
index 90b5b140c6..5597ac5881 100644
--- a/frontend/src/components/User/Settings/CreateUserDrawer.vue
+++ b/frontend/src/components/User/Settings/CreateUserDrawer.vue
@@ -159,7 +159,7 @@ import {
UserType,
} from "@/types/proto/v1/auth_service";
import { State } from "@/types/proto/v1/common";
-import { displayRoleTitle } from "@/utils";
+import { displayRoleTitle, randomString } from "@/utils";
interface LocalState {
isRequesting: boolean;
@@ -196,7 +196,11 @@ const isCreating = computed(() => !props.user);
const allowConfirm = computed(() => {
if (isCreating.value) {
- return state.user.email;
+ if (isDevelopmentIAM.value) {
+ return state.user.email && state.user.roles.length > 0;
+ } else {
+ return state.user.email;
+ }
} else {
return getUpdateMaskFromUsers(props.user!, state.user).length > 0;
}
@@ -239,6 +243,7 @@ const tryCreateOrUpdateUser = async () => {
await userStore.createUser({
...state.user,
title: state.user.title || state.user.email,
+ password: randomString(20),
});
} else {
await userStore.updateUser(
diff --git a/frontend/src/store/modules/auth.ts b/frontend/src/store/modules/auth.ts
index a57d88e031..aeecc74e9a 100644
--- a/frontend/src/store/modules/auth.ts
+++ b/frontend/src/store/modules/auth.ts
@@ -3,7 +3,7 @@ import { isEqual } from "lodash-es";
import { defineStore } from "pinia";
import { computed } from "vue";
import { authServiceClient } from "@/grpcweb";
-import { SignupInfo, ActivateInfo, unknownUser } from "@/types";
+import { SignupInfo, ActivateInfo, unknownUser, PresetRoleType } from "@/types";
import {
LoginRequest,
LoginResponse,
@@ -48,6 +48,7 @@ export const useAuthStore = defineStore("auth_v1", {
title: signupInfo.name,
password: signupInfo.password,
userType: UserType.USER,
+ roles: [PresetRoleType.WORKSPACE_MEMBER],
},
});
await this.login({