const tokenParam = '?token=';
useEffect(() => {
if (!window.location.search.includes(tokenParam)) {
window.location.replace('/');
}
}, []);
function GetPage():any {
return window
.location
.search
.replace('?', '')
.split('&')
.reduce(
function (p, e) {
var a = e.split('=');
// @ts-ignore
p[decodeURIComponent(a[0])] = decodeURIComponent(a[1]);
return p;
},
{}
);
}