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" @keyup.enter="register"
/> />
</div> </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> <div>
<a v-t="'titles.register'" class="btn w-auto" @click="register" /> <a v-t="'titles.register'" class="btn w-auto" @click="register" />
</div> </div>
@ -68,6 +79,10 @@ export default {
methods: { methods: {
register() { register() {
if (!this.username || !this.password) return; if (!this.username || !this.password) return;
if (this.password != this.passwordConfirm) {
alert(this.$t("login.passwords_incorrect"));
return;
}
if (isEmail(this.username) && !this.forceUnsecureRegister) { if (isEmail(this.username) && !this.forceUnsecureRegister) {
this.showUnsecureRegisterDialog = true; this.showUnsecureRegisterDialog = true;
return; return;

View file

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