diff --git a/src/components/account/ChangeToPassword.vue b/src/components/account/ChangeToPassword.vue index 7a2f6a2..86b7c8e 100644 --- a/src/components/account/ChangeToPassword.vue +++ b/src/components/account/ChangeToPassword.vue @@ -10,6 +10,7 @@ placeholder="neues Passwort" autocomplete="new-password" class="rounded-b-none!" + :class="notMatching ? 'border-red-600!' : ''" />
@@ -21,8 +22,10 @@ placeholder="neues Passwort wiederholen" autocomplete="new-password" class="rounded-t-none!" + :class="notMatching ? 'border-red-600!' : ''" />
+

Passwörter stimmen nicht überein

@@ -62,12 +65,22 @@ export default defineComponent({ verification: "loading" as "success" | "loading" | "failed", changeStatus: undefined as undefined | "loading" | "success" | "failed", changeError: "" as string, + notMatching: false as boolean, }; }, mounted() {}, methods: { async change(e: any) { let formData = e.target.elements; + + let new_pw = await hashString(formData.new.value); + let new_rep = await hashString(formData.new_rep.value); + if (new_pw != new_rep) { + this.notMatching = true; + return; + } + this.notMatching = false; + this.changeStatus = "loading"; this.changeError = ""; this.$http diff --git a/src/components/account/PasswordChange.vue b/src/components/account/PasswordChange.vue index f93614b..268e5bc 100644 --- a/src/components/account/PasswordChange.vue +++ b/src/components/account/PasswordChange.vue @@ -21,6 +21,7 @@ placeholder="neues Passwort" autocomplete="new-password" class="rounded-none!" + :class="notMatching ? 'border-red-600!' : ''" />
@@ -32,8 +33,10 @@ placeholder="neues Passwort wiederholen" autocomplete="new-password" class="rounded-t-none!" + :class="notMatching ? 'border-red-600!' : ''" />
+

Passwörter stimmen nicht überein

@@ -65,12 +68,22 @@ export default defineComponent({ verification: "loading" as "success" | "loading" | "failed", changeStatus: undefined as undefined | "loading" | "success" | "failed", changeError: "" as string, + notMatching: false as boolean, }; }, mounted() {}, methods: { async change(e: any) { let formData = e.target.elements; + + let new_pw = await hashString(formData.new.value); + let new_rep = await hashString(formData.new_rep.value); + if (new_pw != new_rep) { + this.notMatching = true; + return; + } + this.notMatching = false; + this.changeStatus = "loading"; this.changeError = ""; this.$http diff --git a/src/views/invite/Verify.vue b/src/views/invite/Verify.vue index ff1977f..0547f3f 100644 --- a/src/views/invite/Verify.vue +++ b/src/views/invite/Verify.vue @@ -56,16 +56,19 @@ placeholder="Passwort" class="rounded-b-none!" autocomplete="new-password" + :class="notMatching ? 'border-red-600!' : ''" /> +

Passwörter stimmen nicht überein

@@ -110,6 +113,7 @@ export default defineComponent({ username: "" as string, inviteStatus: undefined as undefined | "loading" | "success" | "failed", inviteError: "" as string, + notMatching: false as boolean, }; }, mounted() { @@ -138,6 +142,8 @@ export default defineComponent({ if (this.tab == "totp") secret = this.totp(e); else secret = await this.password(e); + if (secret == "") return; + this.inviteStatus = "loading"; this.inviteError = ""; this.$http @@ -166,6 +172,15 @@ export default defineComponent({ }, async password(e: any) { let formData = e.target.elements; + + let new_pw = await hashString(formData.password.value); + let new_rep = await hashString(formData.password_rep.value); + if (new_pw != new_rep) { + this.notMatching = true; + return ""; + } + this.notMatching = false; + return await hashString(formData.password.value); }, }, diff --git a/src/views/reset/Reset.vue b/src/views/reset/Reset.vue index fb05868..9a6bc4c 100644 --- a/src/views/reset/Reset.vue +++ b/src/views/reset/Reset.vue @@ -3,7 +3,7 @@
-

TOTP zurücksetzen

+

Zugang zurücksetzen

@@ -56,16 +56,19 @@ placeholder="Passwort" class="rounded-b-none!" autocomplete="new-password" + :class="notMatching ? 'border-red-600!' : ''" /> +

Passwörter stimmen nicht überein

@@ -110,6 +113,7 @@ export default defineComponent({ otp: undefined as undefined | string, resetStatus: undefined as undefined | "loading" | "success" | "failed", resetError: "" as string, + notMatching: false as boolean, }; }, mounted() { @@ -137,6 +141,8 @@ export default defineComponent({ if (this.tab == "totp") secret = this.totp(e); else secret = await this.password(e); + if (secret == "") return; + this.resetStatus = "loading"; this.resetError = ""; this.$http @@ -165,6 +171,15 @@ export default defineComponent({ }, async password(e: any) { let formData = e.target.elements; + + let new_pw = await hashString(formData.password.value); + let new_rep = await hashString(formData.password_rep.value); + if (new_pw != new_rep) { + this.notMatching = true; + return ""; + } + this.notMatching = false; + return await hashString(formData.password.value); }, }, diff --git a/src/views/reset/Start.vue b/src/views/reset/Start.vue index 95dbad5..a1de3c4 100644 --- a/src/views/reset/Start.vue +++ b/src/views/reset/Start.vue @@ -3,7 +3,7 @@
-

TOTP zurücksetzen

+

Zugang zurücksetzen