summaryrefslogtreecommitdiff
path: root/src/static
diff options
context:
space:
mode:
authorMathijs van Veluw <[email protected]>2024-08-18 21:04:22 +0200
committerGitHub <[email protected]>2024-08-18 21:04:22 +0200
commit669b9db7583327f506a94da03c3cbb6838c0062e (patch)
treec9d09bc05de1d389d7324306932b0d6fb2db60d2 /src/static
parent3466a8040e33c8ac359fed99f3542ed5ed6603fa (diff)
downloadvaultwarden-669b9db7583327f506a94da03c3cbb6838c0062e.tar.gz
vaultwarden-669b9db7583327f506a94da03c3cbb6838c0062e.zip
Fix Vaultwarden Admin page error messages (#4869)
Since the change to camelCase variables the error messages in the Vaultwarden Admin were not shown correctly anymore. This PR fixes this by changing the case of the json key's. Also updated the save and delete of the config to provide a more descriptive error instead of only `Io` or which ever other error might occure. Fixes #4834
Diffstat (limited to 'src/static')
-rw-r--r--src/static/scripts/admin.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/static/scripts/admin.js b/src/static/scripts/admin.js
index bc06c0a3..b194a91d 100644
--- a/src/static/scripts/admin.js
+++ b/src/static/scripts/admin.js
@@ -49,8 +49,8 @@ function _post(url, successMsg, errMsg, body, reload_page = true) {
}).then(respText => {
try {
const respJson = JSON.parse(respText);
- if (respJson.ErrorModel && respJson.ErrorModel.Message) {
- return respJson.ErrorModel.Message;
+ if (respJson.errorModel && respJson.errorModel.message) {
+ return respJson.errorModel.message;
} else {
return Promise.reject({ body: `${respStatus} - ${respStatusText}\n\nUnknown error`, error: true });
}