feat(login): separate error messages for validation

This commit separates the error messages for credential and captcha validation on the login page. Previously, both types of errors displayed the same message, which was confusing for users. Now, distinct messages are shown depending on the error, improving user experience.
This commit is contained in:
Kuon 2023-09-11 16:13:23 +08:00
parent d0c3b8033d
commit 9ffbb96855
5 changed files with 11 additions and 7 deletions

View File

@ -122,7 +122,8 @@
"submit": "Login",
"username": "Username",
"usernameTaken": "Username already taken",
"wrongCredentials": "Wrong credentials"
"wrongCredentials": "Wrong credentials",
"captchaNeeded": "Captcha Needed"
},
"permanent": "Permanent",
"prompts": {

View File

@ -111,7 +111,8 @@
"submit": "ログイン",
"username": "ユーザ名",
"usernameTaken": "Username already taken",
"wrongCredentials": "ユーザ名またはパスワードが間違っています。"
"wrongCredentials": "ユーザ名またはパスワードが間違っています。",
"captchaNeeded": "キャプチャが必要です"
},
"permanent": "永久",
"prompts": {

View File

@ -117,7 +117,8 @@
"submit": "登录",
"username": "用户名",
"usernameTaken": "用户名已经被使用",
"wrongCredentials": "用户名或密码错误"
"wrongCredentials": "用户名或密码错误",
"captchaNeeded": "需要验证"
},
"permanent": "永久",
"prompts": {

View File

@ -111,7 +111,8 @@
"submit": "登入",
"username": "帳號",
"usernameTaken": "用戶名已存在",
"wrongCredentials": "帳號或密碼錯誤"
"wrongCredentials": "帳號或密碼錯誤",
"captchaNeeded": "需要驗證碼"
},
"permanent": "永久",
"prompts": {

View File

@ -97,7 +97,7 @@ export default {
captcha = window.grecaptcha.getResponse();
if (captcha === "") {
this.error = this.$t("login.wrongCredentials");
this.error = this.$t("login.captchaNeeded");
return;
}
}