mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-04 05:10:19 +08:00
feat: fix showing wrong error messages (#1385)
This commit is contained in:
@ -84,7 +84,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("util:Please login first"), "util:Please login first")
|
c.ResponseError(c.T("util:Please login first"), "Please login first")
|
||||||
return "", false
|
return "", false
|
||||||
}
|
}
|
||||||
return userId, true
|
return userId, true
|
||||||
|
@ -224,7 +224,7 @@ class App extends Component {
|
|||||||
this.setLanguage(account);
|
this.setLanguage(account);
|
||||||
} else {
|
} else {
|
||||||
if (res.data !== "Please login first") {
|
if (res.data !== "Please login first") {
|
||||||
Setting.showMessage("error", `Failed to sign in: ${res.msg}`);
|
Setting.showMessage("error", `${i18next.t("application:Failed to sign in")}: ${res.msg}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -249,7 +249,7 @@ class App extends Component {
|
|||||||
account: null,
|
account: null,
|
||||||
});
|
});
|
||||||
|
|
||||||
Setting.showMessage("success", "Logged out successfully");
|
Setting.showMessage("success", i18next.t("application:Logged out successfully"));
|
||||||
const redirectUri = res.data2;
|
const redirectUri = res.data2;
|
||||||
if (redirectUri !== null && redirectUri !== undefined && redirectUri !== "") {
|
if (redirectUri !== null && redirectUri !== undefined && redirectUri !== "") {
|
||||||
Setting.goToLink(redirectUri);
|
Setting.goToLink(redirectUri);
|
||||||
|
@ -293,7 +293,7 @@ class LoginPage extends React.Component {
|
|||||||
const responseType = values["type"];
|
const responseType = values["type"];
|
||||||
|
|
||||||
if (responseType === "login") {
|
if (responseType === "login") {
|
||||||
Setting.showMessage("success", "Logged in successfully");
|
Setting.showMessage("success", i18next.t("application:Logged in successfully"));
|
||||||
|
|
||||||
const link = Setting.getFromLink();
|
const link = Setting.getFromLink();
|
||||||
Setting.goToLink(link);
|
Setting.goToLink(link);
|
||||||
|
@ -92,6 +92,7 @@ class PolicyTable extends React.Component {
|
|||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res.status === "ok") {
|
if (res.status === "ok") {
|
||||||
this.setState({policyLists: res.data});
|
this.setState({policyLists: res.data});
|
||||||
|
Setting.showMessage("success", i18next.t("adapter:Sync policies successfully"));
|
||||||
} else {
|
} else {
|
||||||
Setting.showMessage("error", `${i18next.t("adapter:Failed to sync policies")}: ${res.msg}`);
|
Setting.showMessage("error", `${i18next.t("adapter:Failed to sync policies")}: ${res.msg}`);
|
||||||
}
|
}
|
||||||
@ -293,7 +294,7 @@ class PolicyTable extends React.Component {
|
|||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (<>
|
return (<>
|
||||||
<Button type="primary" onClick={() => {this.synPolicies();}}>
|
<Button type="primary" disabled={this.state.editingIndex !== ""} onClick={() => {this.synPolicies();}}>
|
||||||
{i18next.t("adapter:Sync")}
|
{i18next.t("adapter:Sync")}
|
||||||
</Button>
|
</Button>
|
||||||
{
|
{
|
||||||
|
@ -7,12 +7,13 @@
|
|||||||
},
|
},
|
||||||
"adapter": {
|
"adapter": {
|
||||||
"Edit Adapter": "Edit Adapter",
|
"Edit Adapter": "Edit Adapter",
|
||||||
"Failed to sync policies: ": "Failed to sync policies: ",
|
"Failed to sync policies": "Failed to sync policies",
|
||||||
"New Adapter": "New Adapter",
|
"New Adapter": "New Adapter",
|
||||||
"Policies": "Policies",
|
"Policies": "Policies",
|
||||||
"Policies - Tooltip": "Policies - Tooltip",
|
"Policies - Tooltip": "Policies - Tooltip",
|
||||||
"Repeated policy rules": "Repeated policy rules",
|
"Repeated policy rules": "Repeated policy rules",
|
||||||
"Sync": "Sync"
|
"Sync": "Sync",
|
||||||
|
"Sync policies successfully": "Sync policies successfully"
|
||||||
},
|
},
|
||||||
"application": {
|
"application": {
|
||||||
"Always": "Always",
|
"Always": "Always",
|
||||||
@ -36,6 +37,7 @@
|
|||||||
"Enable signin session - Tooltip": "Aktiviere Anmeldesession - Tooltip",
|
"Enable signin session - Tooltip": "Aktiviere Anmeldesession - Tooltip",
|
||||||
"Enable signup": "Anmeldung aktivieren",
|
"Enable signup": "Anmeldung aktivieren",
|
||||||
"Enable signup - Tooltip": "Whether to allow users to sign up",
|
"Enable signup - Tooltip": "Whether to allow users to sign up",
|
||||||
|
"Failed to sign in": "Failed to sign in",
|
||||||
"File uploaded successfully": "Datei erfolgreich hochgeladen",
|
"File uploaded successfully": "Datei erfolgreich hochgeladen",
|
||||||
"Form CSS": "Form CSS",
|
"Form CSS": "Form CSS",
|
||||||
"Form CSS - Edit": "Form CSS - Edit",
|
"Form CSS - Edit": "Form CSS - Edit",
|
||||||
@ -45,6 +47,8 @@
|
|||||||
"Grant types": "Grant types",
|
"Grant types": "Grant types",
|
||||||
"Grant types - Tooltip": "Grant types - Tooltip",
|
"Grant types - Tooltip": "Grant types - Tooltip",
|
||||||
"Left": "Left",
|
"Left": "Left",
|
||||||
|
"Logged in successfully": "Logged in successfully",
|
||||||
|
"Logged out successfully": "Logged out successfully",
|
||||||
"New Application": "New Application",
|
"New Application": "New Application",
|
||||||
"None": "None",
|
"None": "None",
|
||||||
"Password ON": "Passwort AN",
|
"Password ON": "Passwort AN",
|
||||||
|
@ -7,12 +7,13 @@
|
|||||||
},
|
},
|
||||||
"adapter": {
|
"adapter": {
|
||||||
"Edit Adapter": "Edit Adapter",
|
"Edit Adapter": "Edit Adapter",
|
||||||
"Failed to sync policies: ": "Failed to sync policies: ",
|
"Failed to sync policies": "Failed to sync policies",
|
||||||
"New Adapter": "New Adapter",
|
"New Adapter": "New Adapter",
|
||||||
"Policies": "Policies",
|
"Policies": "Policies",
|
||||||
"Policies - Tooltip": "Policies - Tooltip",
|
"Policies - Tooltip": "Policies - Tooltip",
|
||||||
"Repeated policy rules": "Repeated policy rules",
|
"Repeated policy rules": "Repeated policy rules",
|
||||||
"Sync": "Sync"
|
"Sync": "Sync",
|
||||||
|
"Sync policies successfully": "Sync policies successfully"
|
||||||
},
|
},
|
||||||
"application": {
|
"application": {
|
||||||
"Always": "Always",
|
"Always": "Always",
|
||||||
@ -36,6 +37,7 @@
|
|||||||
"Enable signin session - Tooltip": "Enable signin session - Tooltip",
|
"Enable signin session - Tooltip": "Enable signin session - Tooltip",
|
||||||
"Enable signup": "Enable signup",
|
"Enable signup": "Enable signup",
|
||||||
"Enable signup - Tooltip": "Enable signup - Tooltip",
|
"Enable signup - Tooltip": "Enable signup - Tooltip",
|
||||||
|
"Failed to sign in": "Failed to sign in",
|
||||||
"File uploaded successfully": "File uploaded successfully",
|
"File uploaded successfully": "File uploaded successfully",
|
||||||
"Form CSS": "Form CSS",
|
"Form CSS": "Form CSS",
|
||||||
"Form CSS - Edit": "Form CSS - Edit",
|
"Form CSS - Edit": "Form CSS - Edit",
|
||||||
@ -45,6 +47,8 @@
|
|||||||
"Grant types": "Grant types",
|
"Grant types": "Grant types",
|
||||||
"Grant types - Tooltip": "Grant types - Tooltip",
|
"Grant types - Tooltip": "Grant types - Tooltip",
|
||||||
"Left": "Left",
|
"Left": "Left",
|
||||||
|
"Logged in successfully": "Logged in successfully",
|
||||||
|
"Logged out successfully": "Logged out successfully",
|
||||||
"New Application": "New Application",
|
"New Application": "New Application",
|
||||||
"None": "None",
|
"None": "None",
|
||||||
"Password ON": "Password ON",
|
"Password ON": "Password ON",
|
||||||
|
@ -7,12 +7,13 @@
|
|||||||
},
|
},
|
||||||
"adapter": {
|
"adapter": {
|
||||||
"Edit Adapter": "Edit Adapter",
|
"Edit Adapter": "Edit Adapter",
|
||||||
"Failed to sync policies: ": "Failed to sync policies: ",
|
"Failed to sync policies": "Failed to sync policies",
|
||||||
"New Adapter": "New Adapter",
|
"New Adapter": "New Adapter",
|
||||||
"Policies": "Policies",
|
"Policies": "Policies",
|
||||||
"Policies - Tooltip": "Policies - Tooltip",
|
"Policies - Tooltip": "Policies - Tooltip",
|
||||||
"Repeated policy rules": "Repeated policy rules",
|
"Repeated policy rules": "Repeated policy rules",
|
||||||
"Sync": "Sync"
|
"Sync": "Sync",
|
||||||
|
"Sync policies successfully": "Sync policies successfully"
|
||||||
},
|
},
|
||||||
"application": {
|
"application": {
|
||||||
"Always": "Always",
|
"Always": "Always",
|
||||||
@ -36,6 +37,7 @@
|
|||||||
"Enable signin session - Tooltip": "Activer la session de connexion - infobulle",
|
"Enable signin session - Tooltip": "Activer la session de connexion - infobulle",
|
||||||
"Enable signup": "Activer l'inscription",
|
"Enable signup": "Activer l'inscription",
|
||||||
"Enable signup - Tooltip": "Whether to allow users to sign up",
|
"Enable signup - Tooltip": "Whether to allow users to sign up",
|
||||||
|
"Failed to sign in": "Failed to sign in",
|
||||||
"File uploaded successfully": "Fichier téléchargé avec succès",
|
"File uploaded successfully": "Fichier téléchargé avec succès",
|
||||||
"Form CSS": "Form CSS",
|
"Form CSS": "Form CSS",
|
||||||
"Form CSS - Edit": "Form CSS - Edit",
|
"Form CSS - Edit": "Form CSS - Edit",
|
||||||
@ -45,6 +47,8 @@
|
|||||||
"Grant types": "Grant types",
|
"Grant types": "Grant types",
|
||||||
"Grant types - Tooltip": "Grant types - Tooltip",
|
"Grant types - Tooltip": "Grant types - Tooltip",
|
||||||
"Left": "Left",
|
"Left": "Left",
|
||||||
|
"Logged in successfully": "Logged in successfully",
|
||||||
|
"Logged out successfully": "Logged out successfully",
|
||||||
"New Application": "New Application",
|
"New Application": "New Application",
|
||||||
"None": "None",
|
"None": "None",
|
||||||
"Password ON": "Mot de passe activé",
|
"Password ON": "Mot de passe activé",
|
||||||
|
@ -7,12 +7,13 @@
|
|||||||
},
|
},
|
||||||
"adapter": {
|
"adapter": {
|
||||||
"Edit Adapter": "Edit Adapter",
|
"Edit Adapter": "Edit Adapter",
|
||||||
"Failed to sync policies: ": "Failed to sync policies: ",
|
"Failed to sync policies": "Failed to sync policies",
|
||||||
"New Adapter": "New Adapter",
|
"New Adapter": "New Adapter",
|
||||||
"Policies": "Policies",
|
"Policies": "Policies",
|
||||||
"Policies - Tooltip": "Policies - Tooltip",
|
"Policies - Tooltip": "Policies - Tooltip",
|
||||||
"Repeated policy rules": "Repeated policy rules",
|
"Repeated policy rules": "Repeated policy rules",
|
||||||
"Sync": "Sync"
|
"Sync": "Sync",
|
||||||
|
"Sync policies successfully": "Sync policies successfully"
|
||||||
},
|
},
|
||||||
"application": {
|
"application": {
|
||||||
"Always": "Always",
|
"Always": "Always",
|
||||||
@ -36,6 +37,7 @@
|
|||||||
"Enable signin session - Tooltip": "Enable signin session - Tooltip",
|
"Enable signin session - Tooltip": "Enable signin session - Tooltip",
|
||||||
"Enable signup": "サインアップを有効にする",
|
"Enable signup": "サインアップを有効にする",
|
||||||
"Enable signup - Tooltip": "Whether to allow users to sign up",
|
"Enable signup - Tooltip": "Whether to allow users to sign up",
|
||||||
|
"Failed to sign in": "Failed to sign in",
|
||||||
"File uploaded successfully": "ファイルが正常にアップロードされました",
|
"File uploaded successfully": "ファイルが正常にアップロードされました",
|
||||||
"Form CSS": "Form CSS",
|
"Form CSS": "Form CSS",
|
||||||
"Form CSS - Edit": "Form CSS - Edit",
|
"Form CSS - Edit": "Form CSS - Edit",
|
||||||
@ -45,6 +47,8 @@
|
|||||||
"Grant types": "Grant types",
|
"Grant types": "Grant types",
|
||||||
"Grant types - Tooltip": "Grant types - Tooltip",
|
"Grant types - Tooltip": "Grant types - Tooltip",
|
||||||
"Left": "Left",
|
"Left": "Left",
|
||||||
|
"Logged in successfully": "Logged in successfully",
|
||||||
|
"Logged out successfully": "Logged out successfully",
|
||||||
"New Application": "New Application",
|
"New Application": "New Application",
|
||||||
"None": "None",
|
"None": "None",
|
||||||
"Password ON": "パスワードON",
|
"Password ON": "パスワードON",
|
||||||
|
@ -7,12 +7,13 @@
|
|||||||
},
|
},
|
||||||
"adapter": {
|
"adapter": {
|
||||||
"Edit Adapter": "Edit Adapter",
|
"Edit Adapter": "Edit Adapter",
|
||||||
"Failed to sync policies: ": "Failed to sync policies: ",
|
"Failed to sync policies": "Failed to sync policies",
|
||||||
"New Adapter": "New Adapter",
|
"New Adapter": "New Adapter",
|
||||||
"Policies": "Policies",
|
"Policies": "Policies",
|
||||||
"Policies - Tooltip": "Policies - Tooltip",
|
"Policies - Tooltip": "Policies - Tooltip",
|
||||||
"Repeated policy rules": "Repeated policy rules",
|
"Repeated policy rules": "Repeated policy rules",
|
||||||
"Sync": "Sync"
|
"Sync": "Sync",
|
||||||
|
"Sync policies successfully": "Sync policies successfully"
|
||||||
},
|
},
|
||||||
"application": {
|
"application": {
|
||||||
"Always": "Always",
|
"Always": "Always",
|
||||||
@ -36,6 +37,7 @@
|
|||||||
"Enable signin session - Tooltip": "Enable signin session - Tooltip",
|
"Enable signin session - Tooltip": "Enable signin session - Tooltip",
|
||||||
"Enable signup": "Enable signup",
|
"Enable signup": "Enable signup",
|
||||||
"Enable signup - Tooltip": "Whether to allow users to sign up",
|
"Enable signup - Tooltip": "Whether to allow users to sign up",
|
||||||
|
"Failed to sign in": "Failed to sign in",
|
||||||
"File uploaded successfully": "File uploaded successfully",
|
"File uploaded successfully": "File uploaded successfully",
|
||||||
"Form CSS": "Form CSS",
|
"Form CSS": "Form CSS",
|
||||||
"Form CSS - Edit": "Form CSS - Edit",
|
"Form CSS - Edit": "Form CSS - Edit",
|
||||||
@ -45,6 +47,8 @@
|
|||||||
"Grant types": "Grant types",
|
"Grant types": "Grant types",
|
||||||
"Grant types - Tooltip": "Grant types - Tooltip",
|
"Grant types - Tooltip": "Grant types - Tooltip",
|
||||||
"Left": "Left",
|
"Left": "Left",
|
||||||
|
"Logged in successfully": "Logged in successfully",
|
||||||
|
"Logged out successfully": "Logged out successfully",
|
||||||
"New Application": "New Application",
|
"New Application": "New Application",
|
||||||
"None": "None",
|
"None": "None",
|
||||||
"Password ON": "Password ON",
|
"Password ON": "Password ON",
|
||||||
|
@ -7,12 +7,13 @@
|
|||||||
},
|
},
|
||||||
"adapter": {
|
"adapter": {
|
||||||
"Edit Adapter": "Edit Adapter",
|
"Edit Adapter": "Edit Adapter",
|
||||||
"Failed to sync policies: ": "Failed to sync policies: ",
|
"Failed to sync policies": "Failed to sync policies",
|
||||||
"New Adapter": "New Adapter",
|
"New Adapter": "New Adapter",
|
||||||
"Policies": "Policies",
|
"Policies": "Policies",
|
||||||
"Policies - Tooltip": "Policies - Tooltip",
|
"Policies - Tooltip": "Policies - Tooltip",
|
||||||
"Repeated policy rules": "Repeated policy rules",
|
"Repeated policy rules": "Repeated policy rules",
|
||||||
"Sync": "Sync"
|
"Sync": "Sync",
|
||||||
|
"Sync policies successfully": "Sync policies successfully"
|
||||||
},
|
},
|
||||||
"application": {
|
"application": {
|
||||||
"Always": "Always",
|
"Always": "Always",
|
||||||
@ -36,6 +37,7 @@
|
|||||||
"Enable signin session - Tooltip": "Включить сеанс входа - Подсказка",
|
"Enable signin session - Tooltip": "Включить сеанс входа - Подсказка",
|
||||||
"Enable signup": "Включить регистрацию",
|
"Enable signup": "Включить регистрацию",
|
||||||
"Enable signup - Tooltip": "Whether to allow users to sign up",
|
"Enable signup - Tooltip": "Whether to allow users to sign up",
|
||||||
|
"Failed to sign in": "Failed to sign in",
|
||||||
"File uploaded successfully": "Файл успешно загружен",
|
"File uploaded successfully": "Файл успешно загружен",
|
||||||
"Form CSS": "Form CSS",
|
"Form CSS": "Form CSS",
|
||||||
"Form CSS - Edit": "Form CSS - Edit",
|
"Form CSS - Edit": "Form CSS - Edit",
|
||||||
@ -45,6 +47,8 @@
|
|||||||
"Grant types": "Виды грантов",
|
"Grant types": "Виды грантов",
|
||||||
"Grant types - Tooltip": "Виды грантов - Подсказка",
|
"Grant types - Tooltip": "Виды грантов - Подсказка",
|
||||||
"Left": "Left",
|
"Left": "Left",
|
||||||
|
"Logged in successfully": "Logged in successfully",
|
||||||
|
"Logged out successfully": "Logged out successfully",
|
||||||
"New Application": "Новое приложение",
|
"New Application": "Новое приложение",
|
||||||
"None": "None",
|
"None": "None",
|
||||||
"Password ON": "Пароль ВКЛ",
|
"Password ON": "Пароль ВКЛ",
|
||||||
|
@ -7,12 +7,13 @@
|
|||||||
},
|
},
|
||||||
"adapter": {
|
"adapter": {
|
||||||
"Edit Adapter": "编辑适配器",
|
"Edit Adapter": "编辑适配器",
|
||||||
"Failed to sync policies: ": "同步策略失败: ",
|
"Failed to sync policies": "同步策略失败",
|
||||||
"New Adapter": "添加适配器",
|
"New Adapter": "添加适配器",
|
||||||
"Policies": "策略",
|
"Policies": "策略",
|
||||||
"Policies - Tooltip": "策略",
|
"Policies - Tooltip": "策略",
|
||||||
"Repeated policy rules": "重复的策略",
|
"Repeated policy rules": "重复的策略",
|
||||||
"Sync": "同步"
|
"Sync": "同步",
|
||||||
|
"Sync policies successfully": "同步策略成功"
|
||||||
},
|
},
|
||||||
"application": {
|
"application": {
|
||||||
"Always": "始终开启",
|
"Always": "始终开启",
|
||||||
@ -36,6 +37,7 @@
|
|||||||
"Enable signin session - Tooltip": "从应用登录Casdoor后,Casdoor是否保持会话",
|
"Enable signin session - Tooltip": "从应用登录Casdoor后,Casdoor是否保持会话",
|
||||||
"Enable signup": "启用注册",
|
"Enable signup": "启用注册",
|
||||||
"Enable signup - Tooltip": "是否允许用户注册",
|
"Enable signup - Tooltip": "是否允许用户注册",
|
||||||
|
"Failed to sign in": "登录失败",
|
||||||
"File uploaded successfully": "文件上传成功",
|
"File uploaded successfully": "文件上传成功",
|
||||||
"Form CSS": "表单CSS",
|
"Form CSS": "表单CSS",
|
||||||
"Form CSS - Edit": "编辑表单CSS",
|
"Form CSS - Edit": "编辑表单CSS",
|
||||||
@ -45,6 +47,8 @@
|
|||||||
"Grant types": "OAuth授权类型",
|
"Grant types": "OAuth授权类型",
|
||||||
"Grant types - Tooltip": "选择允许哪些OAuth协议中的Grant types",
|
"Grant types - Tooltip": "选择允许哪些OAuth协议中的Grant types",
|
||||||
"Left": "居左",
|
"Left": "居左",
|
||||||
|
"Logged in successfully": "登录成功",
|
||||||
|
"Logged out successfully": "登出成功",
|
||||||
"New Application": "添加应用",
|
"New Application": "添加应用",
|
||||||
"None": "关闭",
|
"None": "关闭",
|
||||||
"Password ON": "开启密码",
|
"Password ON": "开启密码",
|
||||||
|
Reference in New Issue
Block a user