git.iko.soy/typeable/oauth2-proxy
on master help sign in
Fix URI fragment handling

Fixes #1205

commit818938add29fb50086dba4b9b5a77f27e2059f71 authorTarvi Pillessaar <tarvip@gmail.com> dateWed 19 May 2021, 11:50 (5 years ago) parent823cb14
2 files changed+18−17
CHANGELOG.md+1 pkg/app/pagewriter/sign_in.html+17−17
CHANGELOG.md+1
@@ -11,6 +11,7 @@
1111- [#1108](https://github.com/oauth2-proxy/oauth2-proxy/pull/1108) Add alternative ways to generate cookie secrets to docs (@JoelSpeed)
1212- [#1142](https://github.com/oauth2-proxy/oauth2-proxy/pull/1142) Add pagewriter to upstream proxy (@JoelSpeed)
1313- [#1181](https://github.com/oauth2-proxy/oauth2-proxy/pull/1181) Fix incorrect `cfg` name in show-debug-on-error flag (@iTaybb)
14+- [#1207](https://github.com/oauth2-proxy/oauth2-proxy/pull/1207) Fix URI fragment handling on sign-in page, regression introduced in 7.1.0 (@tarvip)
1415
1516# V7.1.3
1617
pkg/app/pagewriter/sign_in.html+17−17
@@ -22,23 +22,6 @@
2222 text-decoration: underline;
2323 }
2424 </style>
25−
26− <script>
27− if (window.location.hash) {
28− (function() {
29− var inputs = document.getElementsByName('rd');
30− for (var i = 0; i < inputs.length; i++) {
31− // Add hash, but make sure it is only added once
32− var idx = inputs[i].value.indexOf('#');
33− if (idx >= 0) {
34− // Remove existing hash from URL
35− inputs[i].value = inputs[i].value.substr(0, idx);
36− }
37− inputs[i].value += window.location.hash;
38− }
39− })();
40− }
41− </script>
4225 </head>
4326 <body class="has-background-light">
4427 <section class="section">
@@ -82,6 +65,23 @@
8265 </div>
8366 </section>
8467
68+ <script>
69+ if (window.location.hash) {
70+ (function() {
71+ var inputs = document.getElementsByName('rd');
72+ for (var i = 0; i < inputs.length; i++) {
73+ // Add hash, but make sure it is only added once
74+ var idx = inputs[i].value.indexOf('#');
75+ if (idx >= 0) {
76+ // Remove existing hash from URL
77+ inputs[i].value = inputs[i].value.substr(0, idx);
78+ }
79+ inputs[i].value += window.location.hash;
80+ }
81+ })();
82+ }
83+ </script>
84+
8585 <footer class="footer has-text-grey has-background-light is-size-7">
8686 <div class="content has-text-centered">
8787 {{ if eq .Footer "-" }}