feat: fix showing wrong error message: "Please sign in first" (#1245)

This commit is contained in:
Yaodong Yu
2022-10-27 23:50:45 +08:00
committed by GitHub
parent 971e53dfd8
commit 80bf29d79a
17 changed files with 9 additions and 11 deletions

View File

@ -83,7 +83,7 @@ func (c *ApiController) SetTokenErrorHttpStatus() {
func (c *ApiController) RequireSignedIn() (string, bool) { func (c *ApiController) RequireSignedIn() (string, bool) {
userId := c.GetSessionUsername() userId := c.GetSessionUsername()
if userId == "" { if userId == "" {
c.ResponseError(c.T("LoginErr.SignInFirst")) c.ResponseError(c.T("LoginErr.LoginFirst"), "Please login first")
return "", false return "", false
} }
return userId, true return userId, true

View File

@ -51,7 +51,6 @@ OldUser = The account for provider: %s and username: %s (%s) is already linked t
ProviderCanNotSignUp = The account for provider: %s and username: %s (%s) does not exist and is not allowed to sign up as new account via %%s, please use another way to sign up ProviderCanNotSignUp = The account for provider: %s and username: %s (%s) does not exist and is not allowed to sign up as new account via %%s, please use another way to sign up
SessionOutdated = Session outdated, please login again SessionOutdated = Session outdated, please login again
SignOutFirst = Please sign out first before signing in SignOutFirst = Please sign out first before signing in
SignInFirst = Please sign in first
UserDoNotExist = The user: %s/%s doesn't exist UserDoNotExist = The user: %s/%s doesn't exist
UserIsForbidden = The user is forbidden to sign in, please contact the administrator UserIsForbidden = The user is forbidden to sign in, please contact the administrator
UnknownAuthentication = Unknown authentication type (not password or provider), form = %s UnknownAuthentication = Unknown authentication type (not password or provider), form = %s

View File

@ -51,7 +51,6 @@ OldUser = The account for provider: %s and username: %s (%s) is already linked t
ProviderCanNotSignUp = The account for provider: %s and username: %s (%s) does not exist and is not allowed to sign up as new account via %%s, please use another way to sign up ProviderCanNotSignUp = The account for provider: %s and username: %s (%s) does not exist and is not allowed to sign up as new account via %%s, please use another way to sign up
SessionOutdated = Session outdated, please login again SessionOutdated = Session outdated, please login again
SignOutFirst = Please sign out first before signing in SignOutFirst = Please sign out first before signing in
SignInFirst = Please sign in first
UserDoNotExist = The user: %s/%s doesn't exist UserDoNotExist = The user: %s/%s doesn't exist
UserIsForbidden = The user is forbidden to sign in, please contact the administrator UserIsForbidden = The user is forbidden to sign in, please contact the administrator
UnknownAuthentication = Unknown authentication type (not password or provider), form = %s UnknownAuthentication = Unknown authentication type (not password or provider), form = %s

View File

@ -51,7 +51,6 @@ OldUser = The account for provider: %s and username: %s (%s) is already linked t
ProviderCanNotSignUp = The account for provider: %s and username: %s (%s) does not exist and is not allowed to sign up as new account via %%s, please use another way to sign up ProviderCanNotSignUp = The account for provider: %s and username: %s (%s) does not exist and is not allowed to sign up as new account via %%s, please use another way to sign up
SessionOutdated = Session outdated, please login again SessionOutdated = Session outdated, please login again
SignOutFirst = Please sign out first before signing in SignOutFirst = Please sign out first before signing in
SignInFirst = Please sign in first
UserDoNotExist = The user: %s/%s doesn't exist UserDoNotExist = The user: %s/%s doesn't exist
UserIsForbidden = The user is forbidden to sign in, please contact the administrator UserIsForbidden = The user is forbidden to sign in, please contact the administrator
UnknownAuthentication = Unknown authentication type (not password or provider), form = %s UnknownAuthentication = Unknown authentication type (not password or provider), form = %s

View File

@ -51,7 +51,6 @@ OldUser = The account for provider: %s and username: %s (%s) is already linked t
ProviderCanNotSignUp = The account for provider: %s and username: %s (%s) does not exist and is not allowed to sign up as new account via %%s, please use another way to sign up ProviderCanNotSignUp = The account for provider: %s and username: %s (%s) does not exist and is not allowed to sign up as new account via %%s, please use another way to sign up
SessionOutdated = Session outdated, please login again SessionOutdated = Session outdated, please login again
SignOutFirst = Please sign out first before signing in SignOutFirst = Please sign out first before signing in
SignInFirst = Please sign in first
UserDoNotExist = The user: %s/%s doesn't exist UserDoNotExist = The user: %s/%s doesn't exist
UserIsForbidden = The user is forbidden to sign in, please contact the administrator UserIsForbidden = The user is forbidden to sign in, please contact the administrator
UnknownAuthentication = Unknown authentication type (not password or provider), form = %s UnknownAuthentication = Unknown authentication type (not password or provider), form = %s

View File

@ -51,7 +51,6 @@ OldUser = The account for provider: %s and username: %s (%s) is already linked t
ProviderCanNotSignUp = The account for provider: %s and username: %s (%s) does not exist and is not allowed to sign up as new account via %%s, please use another way to sign up ProviderCanNotSignUp = The account for provider: %s and username: %s (%s) does not exist and is not allowed to sign up as new account via %%s, please use another way to sign up
SessionOutdated = Session outdated, please login again SessionOutdated = Session outdated, please login again
SignOutFirst = Please sign out first before signing in SignOutFirst = Please sign out first before signing in
SignInFirst = Please sign in first
UserDoNotExist = The user: %s/%s doesn't exist UserDoNotExist = The user: %s/%s doesn't exist
UserIsForbidden = The user is forbidden to sign in, please contact the administrator UserIsForbidden = The user is forbidden to sign in, please contact the administrator
UnknownAuthentication = Unknown authentication type (not password or provider), form = %s UnknownAuthentication = Unknown authentication type (not password or provider), form = %s

View File

@ -51,7 +51,6 @@ OldUser = The account for provider: %s and username: %s (%s) is already linked t
ProviderCanNotSignUp = The account for provider: %s and username: %s (%s) does not exist and is not allowed to sign up as new account via %%s, please use another way to sign up ProviderCanNotSignUp = The account for provider: %s and username: %s (%s) does not exist and is not allowed to sign up as new account via %%s, please use another way to sign up
SessionOutdated = Session outdated, please login again SessionOutdated = Session outdated, please login again
SignOutFirst = Please sign out first before signing in SignOutFirst = Please sign out first before signing in
SignInFirst = Please sign in first
UserDoNotExist = The user: %s/%s doesn't exist UserDoNotExist = The user: %s/%s doesn't exist
UserIsForbidden = The user is forbidden to sign in, please contact the administrator UserIsForbidden = The user is forbidden to sign in, please contact the administrator
UnknownAuthentication = Unknown authentication type (not password or provider), form = %s UnknownAuthentication = Unknown authentication type (not password or provider), form = %s

View File

@ -51,7 +51,6 @@ OldUser = The account for provider: %s and username: %s (%s) is already linked t
ProviderCanNotSignUp = The account for provider: %s and username: %s (%s) does not exist and is not allowed to sign up as new account via %%s, please use another way to sign up ProviderCanNotSignUp = The account for provider: %s and username: %s (%s) does not exist and is not allowed to sign up as new account via %%s, please use another way to sign up
SessionOutdated = Session outdated, please login again SessionOutdated = Session outdated, please login again
SignOutFirst = Please sign out first before signing in SignOutFirst = Please sign out first before signing in
SignInFirst = Please sign in first
UserDoNotExist = The user: %s/%s doesn't exist UserDoNotExist = The user: %s/%s doesn't exist
UserIsForbidden = The user is forbidden to sign in, please contact the administrator UserIsForbidden = The user is forbidden to sign in, please contact the administrator
UnknownAuthentication = Unknown authentication type (not password or provider), form = %s UnknownAuthentication = Unknown authentication type (not password or provider), form = %s

View File

@ -51,7 +51,6 @@ OldUser = 提供商账户: %s 与用户名: %s (%s) 已经与其他账户绑定:
ProviderCanNotSignUp = 提供商账户: %s 与用户名: %s (%s) 不存在且 不允许通过 %s 注册新账户, 请使用其他方式注册 ProviderCanNotSignUp = 提供商账户: %s 与用户名: %s (%s) 不存在且 不允许通过 %s 注册新账户, 请使用其他方式注册
SignOutFirst = 请在登录前登出 SignOutFirst = 请在登录前登出
SessionOutdated = Session已过期请重新登陆 SessionOutdated = Session已过期请重新登陆
SignInFirst = 请先登出
UserDoNotExist = 用户不存在: %s/%s UserDoNotExist = 用户不存在: %s/%s
UserIsForbidden = 该用户被禁止登陆,请联系管理员 UserIsForbidden = 该用户被禁止登陆,请联系管理员
UnknownAuthentication = 未知的认证类型 (非密码或提供商认证), form = %s UnknownAuthentication = 未知的认证类型 (非密码或提供商认证), form = %s

View File

@ -221,10 +221,9 @@ class App extends Component {
if (res.status === "ok") { if (res.status === "ok") {
account = res.data; account = res.data;
account.organization = res.data2; account.organization = res.data2;
this.setLanguage(account); this.setLanguage(account);
} else { } else {
if (res.msg !== "Please sign in first") { if (res.data !== "Please login first") {
Setting.showMessage("error", `Failed to sign in: ${res.msg}`); Setting.showMessage("error", `Failed to sign in: ${res.msg}`);
} }
} }

View File

@ -695,6 +695,7 @@
"Old Password": "Altes Passwort", "Old Password": "Altes Passwort",
"Password": "Passwort", "Password": "Passwort",
"Password Set": "Passwort setzen", "Password Set": "Passwort setzen",
"Please select avatar from resources": "Please select avatar from resources",
"Properties": "Eigenschaften", "Properties": "Eigenschaften",
"Re-enter New": "Neu erneut eingeben", "Re-enter New": "Neu erneut eingeben",
"Reset Email...": "Reset Email...", "Reset Email...": "Reset Email...",

View File

@ -695,6 +695,7 @@
"Old Password": "Old Password", "Old Password": "Old Password",
"Password": "Password", "Password": "Password",
"Password Set": "Password Set", "Password Set": "Password Set",
"Please select avatar from resources": "Please select avatar from resources",
"Properties": "Properties", "Properties": "Properties",
"Re-enter New": "Re-enter New", "Re-enter New": "Re-enter New",
"Reset Email...": "Reset Email...", "Reset Email...": "Reset Email...",

View File

@ -695,6 +695,7 @@
"Old Password": "Ancien mot de passe", "Old Password": "Ancien mot de passe",
"Password": "Mot de passe", "Password": "Mot de passe",
"Password Set": "Mot de passe défini", "Password Set": "Mot de passe défini",
"Please select avatar from resources": "Please select avatar from resources",
"Properties": "Propriétés", "Properties": "Propriétés",
"Re-enter New": "Nouvelle entrée", "Re-enter New": "Nouvelle entrée",
"Reset Email...": "Reset Email...", "Reset Email...": "Reset Email...",

View File

@ -695,6 +695,7 @@
"Old Password": "古いパスワード", "Old Password": "古いパスワード",
"Password": "パスワード", "Password": "パスワード",
"Password Set": "パスワード設定", "Password Set": "パスワード設定",
"Please select avatar from resources": "Please select avatar from resources",
"Properties": "プロパティー", "Properties": "プロパティー",
"Re-enter New": "新しい入力", "Re-enter New": "新しい入力",
"Reset Email...": "Reset Email...", "Reset Email...": "Reset Email...",

View File

@ -695,6 +695,7 @@
"Old Password": "Old Password", "Old Password": "Old Password",
"Password": "Password", "Password": "Password",
"Password Set": "Password Set", "Password Set": "Password Set",
"Please select avatar from resources": "Please select avatar from resources",
"Properties": "Properties", "Properties": "Properties",
"Re-enter New": "Re-enter New", "Re-enter New": "Re-enter New",
"Reset Email...": "Reset Email...", "Reset Email...": "Reset Email...",

View File

@ -695,6 +695,7 @@
"Old Password": "Старый пароль", "Old Password": "Старый пароль",
"Password": "Пароль", "Password": "Пароль",
"Password Set": "Пароль установлен", "Password Set": "Пароль установлен",
"Please select avatar from resources": "Please select avatar from resources",
"Properties": "Свойства", "Properties": "Свойства",
"Re-enter New": "Введите еще раз", "Re-enter New": "Введите еще раз",
"Reset Email...": "Reset Email...", "Reset Email...": "Reset Email...",

View File

@ -695,6 +695,7 @@
"Old Password": "旧密码", "Old Password": "旧密码",
"Password": "密码", "Password": "密码",
"Password Set": "密码已设置", "Password Set": "密码已设置",
"Please select avatar from resources": "从资源中选择...",
"Properties": "属性", "Properties": "属性",
"Re-enter New": "重复新密码", "Re-enter New": "重复新密码",
"Reset Email...": "重置邮箱...", "Reset Email...": "重置邮箱...",