blob: a9ac92fd0871de3f69a6e0cfc53aef98452c7ba5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
%h3.page-title= _("Redirecting")
%div
%a{ :href => redirect_uri } Click here to redirect to #{redirect_uri}
= javascript_tag do
:plain
(function() {
// Only permit a basic set of characters in the fragment.
const allowedRegex = /^#[\w-]+$/g;
const hash = window.location.hash;
let redirectUri = "#{redirect_uri}";
if (window.location.hash && window.location.hash.search(allowedRegex) === 0 && redirectUri.indexOf('#') === -1) {
redirectUri = redirectUri + hash;
}
window.location = redirectUri;
})();
|