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) {
userId := c.GetSessionUsername()
if userId == "" {
c.ResponseError(c.T("LoginErr.SignInFirst"))
c.ResponseError(c.T("LoginErr.LoginFirst"), "Please login first")
return "", false
}
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
SessionOutdated = Session outdated, please login again
SignOutFirst = Please sign out first before signing in
SignInFirst = Please sign in first
UserDoNotExist = The user: %s/%s doesn't exist
UserIsForbidden = The user is forbidden to sign in, please contact the administrator
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
SessionOutdated = Session outdated, please login again
SignOutFirst = Please sign out first before signing in
SignInFirst = Please sign in first
UserDoNotExist = The user: %s/%s doesn't exist
UserIsForbidden = The user is forbidden to sign in, please contact the administrator
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
SessionOutdated = Session outdated, please login again
SignOutFirst = Please sign out first before signing in
SignInFirst = Please sign in first
UserDoNotExist = The user: %s/%s doesn't exist
UserIsForbidden = The user is forbidden to sign in, please contact the administrator
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
SessionOutdated = Session outdated, please login again
SignOutFirst = Please sign out first before signing in
SignInFirst = Please sign in first
UserDoNotExist = The user: %s/%s doesn't exist
UserIsForbidden = The user is forbidden to sign in, please contact the administrator
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
SessionOutdated = Session outdated, please login again
SignOutFirst = Please sign out first before signing in
SignInFirst = Please sign in first
UserDoNotExist = The user: %s/%s doesn't exist
UserIsForbidden = The user is forbidden to sign in, please contact the administrator
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
SessionOutdated = Session outdated, please login again
SignOutFirst = Please sign out first before signing in
SignInFirst = Please sign in first
UserDoNotExist = The user: %s/%s doesn't exist
UserIsForbidden = The user is forbidden to sign in, please contact the administrator
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
SessionOutdated = Session outdated, please login again
SignOutFirst = Please sign out first before signing in
SignInFirst = Please sign in first
UserDoNotExist = The user: %s/%s doesn't exist
UserIsForbidden = The user is forbidden to sign in, please contact the administrator
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 注册新账户, 请使用其他方式注册
SignOutFirst = 请在登录前登出
SessionOutdated = Session已过期请重新登陆
SignInFirst = 请先登出
UserDoNotExist = 用户不存在: %s/%s
UserIsForbidden = 该用户被禁止登陆,请联系管理员
UnknownAuthentication = 未知的认证类型 (非密码或提供商认证), form = %s

View File

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

View File

@ -695,6 +695,7 @@
"Old Password": "Altes Passwort",
"Password": "Passwort",
"Password Set": "Passwort setzen",
"Please select avatar from resources": "Please select avatar from resources",
"Properties": "Eigenschaften",
"Re-enter New": "Neu erneut eingeben",
"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...",

View File

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

View File

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

View File

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

View File

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