aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBlackDex <[email protected]>2022-12-03 17:28:25 +0100
committerDaniel GarcĂ­a <[email protected]>2022-12-04 23:17:49 +0100
commitd6dc6070f3cc4c1a19b65cdee8edd413c74df0ea (patch)
tree9d8dce33ad7f1ad792a8392ffa6d328b5a68a96a /src
parentd66323b742bd98e16e0fd0124de840ebb8564ea3 (diff)
downloadvaultwarden-d6dc6070f3cc4c1a19b65cdee8edd413c74df0ea.tar.gz
vaultwarden-d6dc6070f3cc4c1a19b65cdee8edd413c74df0ea.zip
Fix admin repost warning.
Currently when you login into the admin, and then directly hit the save button, it will come with a re-post/re-submit warning. This has to do with the `window.location.reload()` function, which triggers the admin login POST again. By changing the way to reload the page, we prevent this repost.
Diffstat (limited to 'src')
-rw-r--r--src/static/templates/admin/base.hbs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/static/templates/admin/base.hbs b/src/static/templates/admin/base.hbs
index 220b562d..8b5e891b 100644
--- a/src/static/templates/admin/base.hbs
+++ b/src/static/templates/admin/base.hbs
@@ -32,7 +32,11 @@
<script>
'use strict';
- function reload() { window.location.reload(); }
+ function reload() {
+ // Reload the page by setting the exact same href
+ // Using window.location.reload() could cause a repost.
+ window.location = window.location.href;
+ }
function msg(text, reload_page = true) {
text && alert(text);
reload_page && reload();