diff --git a/controllers/util.go b/controllers/util.go index 4a2fd85c..dc5fb9b3 100644 --- a/controllers/util.go +++ b/controllers/util.go @@ -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 diff --git a/i18n/languages/locale_de.ini b/i18n/languages/locale_de.ini index 8dc23065..b6e118fd 100644 --- a/i18n/languages/locale_de.ini +++ b/i18n/languages/locale_de.ini @@ -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 diff --git a/i18n/languages/locale_en.ini b/i18n/languages/locale_en.ini index 31be24df..1ea8376a 100644 --- a/i18n/languages/locale_en.ini +++ b/i18n/languages/locale_en.ini @@ -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 diff --git a/i18n/languages/locale_es.ini b/i18n/languages/locale_es.ini index 8dc23065..b6e118fd 100644 --- a/i18n/languages/locale_es.ini +++ b/i18n/languages/locale_es.ini @@ -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 diff --git a/i18n/languages/locale_fr.ini b/i18n/languages/locale_fr.ini index 8dc23065..b6e118fd 100644 --- a/i18n/languages/locale_fr.ini +++ b/i18n/languages/locale_fr.ini @@ -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 diff --git a/i18n/languages/locale_ja.ini b/i18n/languages/locale_ja.ini index 8dc23065..b6e118fd 100644 --- a/i18n/languages/locale_ja.ini +++ b/i18n/languages/locale_ja.ini @@ -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 diff --git a/i18n/languages/locale_ko.ini b/i18n/languages/locale_ko.ini index 8dc23065..b6e118fd 100644 --- a/i18n/languages/locale_ko.ini +++ b/i18n/languages/locale_ko.ini @@ -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 diff --git a/i18n/languages/locale_ru.ini b/i18n/languages/locale_ru.ini index 8dc23065..b6e118fd 100644 --- a/i18n/languages/locale_ru.ini +++ b/i18n/languages/locale_ru.ini @@ -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 diff --git a/i18n/languages/locale_zh.ini b/i18n/languages/locale_zh.ini index 49903db1..344c369e 100644 --- a/i18n/languages/locale_zh.ini +++ b/i18n/languages/locale_zh.ini @@ -51,7 +51,6 @@ OldUser = 提供商账户: %s 与用户名: %s (%s) 已经与其他账户绑定: ProviderCanNotSignUp = 提供商账户: %s 与用户名: %s (%s) 不存在且 不允许通过 %s 注册新账户, 请使用其他方式注册 SignOutFirst = 请在登录前登出 SessionOutdated = Session已过期,请重新登陆 -SignInFirst = 请先登出 UserDoNotExist = 用户不存在: %s/%s UserIsForbidden = 该用户被禁止登陆,请联系管理员 UnknownAuthentication = 未知的认证类型 (非密码或提供商认证), form = %s diff --git a/web/src/App.js b/web/src/App.js index f28c565c..97525368 100644 --- a/web/src/App.js +++ b/web/src/App.js @@ -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}`); } } diff --git a/web/src/locales/de/data.json b/web/src/locales/de/data.json index 6d6bdd64..31ba30ea 100644 --- a/web/src/locales/de/data.json +++ b/web/src/locales/de/data.json @@ -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...", diff --git a/web/src/locales/en/data.json b/web/src/locales/en/data.json index 51ce27a9..cce30742 100644 --- a/web/src/locales/en/data.json +++ b/web/src/locales/en/data.json @@ -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...", diff --git a/web/src/locales/fr/data.json b/web/src/locales/fr/data.json index 774d60e2..c8411e23 100644 --- a/web/src/locales/fr/data.json +++ b/web/src/locales/fr/data.json @@ -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...", diff --git a/web/src/locales/ja/data.json b/web/src/locales/ja/data.json index 4c171c92..1317c87f 100644 --- a/web/src/locales/ja/data.json +++ b/web/src/locales/ja/data.json @@ -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...", diff --git a/web/src/locales/ko/data.json b/web/src/locales/ko/data.json index 50bce840..8e240f68 100644 --- a/web/src/locales/ko/data.json +++ b/web/src/locales/ko/data.json @@ -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...", diff --git a/web/src/locales/ru/data.json b/web/src/locales/ru/data.json index 0e6315fe..3f1913ce 100644 --- a/web/src/locales/ru/data.json +++ b/web/src/locales/ru/data.json @@ -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...", diff --git a/web/src/locales/zh/data.json b/web/src/locales/zh/data.json index 7ceb1264..0fd68d01 100644 --- a/web/src/locales/zh/data.json +++ b/web/src/locales/zh/data.json @@ -695,6 +695,7 @@ "Old Password": "旧密码", "Password": "密码", "Password Set": "密码已设置", + "Please select avatar from resources": "从资源中选择...", "Properties": "属性", "Re-enter New": "重复新密码", "Reset Email...": "重置邮箱...",