diff --git a/packages/frontend/src/components/Signin.vue b/packages/frontend/src/components/Signin.vue
index 2494728..b5a7c44 100644
--- a/packages/frontend/src/components/Signin.vue
+++ b/packages/frontend/src/components/Signin.vue
@@ -27,6 +27,7 @@
@@ -78,7 +79,6 @@
class="pt-8"
size="50"
placeholder="Enter your passcode"
- v-on:keyup="btnStatus"
v-model="passcode"
ref="psc"
@input="(p) => (passcode = p.target.value)"
@@ -94,7 +94,6 @@
(username = u.target.value)"
@@ -107,7 +106,6 @@
(password = p.target.value)"
@@ -122,7 +120,7 @@
- Sign in
+ Sign in
@@ -149,11 +147,10 @@ export default {
props: ["target", "rpc"],
data() {
return {
- disableButton: true,
isLoggedIn: "",
authFailed: "",
ssoOrCredentials: "Credentials",
- endpoint: "",
+ endpoint: this.target.defaultEndpoint,
passcode: "",
username: "",
password: "",
@@ -161,7 +158,6 @@ export default {
},
updated() {
this.isLoggedIn === "" ? (this.isLoggedIn = this.target.isLoggedIn) : "";
- this.endpoint === "" ? (this.endpoint = this.target.defaultEndpoint) : "";
},
watch: {
isLoggedIn(newVal) {
@@ -184,14 +180,15 @@ export default {
credentialsVisibility() {
return this.ssoOrCredentials === "Credentials" ? "" : "none";
},
+ isSignInEnable() {
+ let isValue = !!this.endpoint;
+ if (isValue) {
+ isValue = this.ssoOrCredentials == "SSO" ? !!this.passcode : !!this.username && !!this.password;
+ }
+ return !isValue;
+ },
},
methods: {
- btnStatus() {
- if (this.ssoOrCredentials == "Credentials" && this.username != "" && this.password != "")
- this.disableButton = false;
- else if (this.ssoOrCredentials == "SSO" && this.passcode != "") this.disableButton = false;
- else this.disableButton = true;
- },
setEndpoint(val) {
this.endpoint = val.target.value;
},
@@ -199,12 +196,10 @@ export default {
navigator.clipboard.readText().then((clipText) => {
this.passcode = clipText;
this.$refs.psc.value = this.passcode;
- this.btnStatus();
});
},
setSSO(val) {
this.ssoOrCredentials = val.target.value;
- this.disableButton = true;
},
SigninClicked() {
let payload = {};