register page: add password confirm field

This commit is contained in:
Bnyro 2023-08-14 10:03:26 +02:00
parent 8a1a97afa5
commit 00fad8c943
2 changed files with 18 additions and 1 deletions

View File

@ -25,6 +25,17 @@
@keyup.enter="register"
/>
</div>
<div>
<input
v-model="passwordConfirm"
class="input"
type="password"
autocomplete="password"
:placeholder="$t('login.password_confirm')"
:aria-label="$t('login.password_confirm')"
@keyup.enter="register"
/>
</div>
<div>
<a v-t="'titles.register'" class="btn w-auto" @click="register" />
</div>
@ -68,6 +79,10 @@ export default {
methods: {
register() {
if (!this.username || !this.password) return;
if (this.password != this.passwordConfirm) {
alert(this.$t("login.passwords_incorrect"));
return;
}
if (isEmail(this.username) && !this.forceUnsecureRegister) {
this.showUnsecureRegisterDialog = true;
return;

View File

@ -162,7 +162,9 @@
},
"login": {
"username": "Username",
"password": "Password"
"password": "Password",
"password_confirm": "Confirm password",
"passwords_incorrect": "Passwords don't match!"
},
"video": {
"videos": "Videos",