Skip to content

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

Navigate to signup if needs admin setup.

天舟1c177e0a4c0f
diff --git a/frontend/src/views/auth/Signin.vue b/frontend/src/views/auth/Signin.vue
index b484d8856d..332e58eaa4 100644
--- a/frontend/src/views/auth/Signin.vue
+++ b/frontend/src/views/auth/Signin.vue
@@ -36,8 +36,7 @@
focus:outline-none
focus:shadow-outline-blue
focus:border-control-border
- sm:text-sm
- sm:leading-5
+ sm:text-sm sm:leading-5
"
/>
</div>
@@ -88,8 +87,7 @@
focus:outline-none
focus:shadow-outline-blue
focus:border-control-border
- sm:text-sm
- sm:leading-5
+ sm:text-sm sm:leading-5
"
/>
</div>
@@ -125,10 +123,10 @@
</template>
<script lang="ts">
-import { computed, reactive } from "vue";
+import { computed, reactive, watchEffect } from "vue";
import { useStore } from "vuex";
import { useRouter } from "vue-router";
-import { LoginInfo } from "../../types";
+import { LoginInfo, ServerInfo } from "../../types";
import { isRelease, isValidEmail } from "../../utils";
interface LocalState {
@@ -147,6 +145,19 @@ export default {
password: isRelease() ? "" : "1024",
});
+ const prepareInfo = () => {
+ store.dispatch("actuator/info").then((info: ServerInfo) => {
+ // Navigate to signup if needs admin setup.
+ // Unable to achieve it in router.beforeEach because actutor/info is fetched async and returns
+ // after router has already made the decision on first page load.
+ if (info.needAdminSetup) {
+ router.push({ name: "auth.signup", replace: true });
+ }
+ });
+ };
+
+ watchEffect(prepareInfo);
+
const allowSignin = computed(() => {
return isValidEmail(state.email) && state.password;
});