浏览代码

feat(Login): try and attempt login on password manager autofill

Signed-off-by: Jonathan <theflametrooper@gmail.com>
Jonathan 3 年之前
父节点
当前提交
f3a32fec57
共有 2 个文件被更改,包括 13 次插入2 次删除
  1. 12 1
      frontend/src/components/modals/Login.vue
  2. 1 1
      frontend/src/pages/ResetPassword.vue

+ 12 - 1
frontend/src/components/modals/Login.vue

@@ -39,6 +39,7 @@
 								type="password"
 								ref="password"
 								placeholder="Password..."
+								@input="checkForAutofill($event)"
 								@keypress="submitOnEnter(submitModal, $event)"
 							/>
 							<a @click="togglePasswordVisibility()">
@@ -143,7 +144,17 @@ export default {
 		if (this.$route.path === "/login") this.isPage = true;
 	},
 	methods: {
-		submitOnEnter: (cb, event) => {
+		checkForAutofill(event) {
+			if (
+				event.target.value !== "" &&
+				event.inputType === undefined &&
+				event.data === undefined &&
+				event.dataTransfer === undefined &&
+				event.isComposing === undefined
+			)
+				this.submitModal();
+		},
+		submitOnEnter(cb, event) {
 			if (event.which === 13) cb();
 		},
 		submitModal() {

+ 1 - 1
frontend/src/pages/ResetPassword.vue

@@ -78,7 +78,7 @@
 						</h2>
 						<p
 							class="content-box-description"
-							v-if="!this.email.hasBeenSentAlready"
+							v-if="!email.hasBeenSentAlready"
 						>
 							A code has been sent to
 							<strong>{{ email.value }}.</strong>