diff --git a/CHANGELOG.md b/CHANGELOG.md index 31798714..299355d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ ## Changes since v5.0.0 +- [#353](https://github.com/pusher/oauth2_proxy/pull/353) Fix login page fragment handling after soft reload on Firefox (@ffdybuster) + # v5.0.0 ## Release Hightlights diff --git a/templates.go b/templates.go index 99637ed3..002e2b46 100644 --- a/templates.go +++ b/templates.go @@ -135,6 +135,12 @@ func getTemplates() *template.Template { (function() { var inputs = document.getElementsByName('rd'); for (var i = 0; i < inputs.length; i++) { + // Add hash, but make sure it is only added once + var idx = inputs[i].value.indexOf('#'); + if (idx >= 0) { + // Remove existing hash from URL + inputs[i].value = inputs[i].value.substr(0, idx); + } inputs[i].value += window.location.hash; } })();