Add configuration and adjusted redirect functionality

This commit is contained in:
Donald Cheng Hong Zou
2022-03-22 16:13:57 -04:00
parent bdd984a887
commit cc1dd682e8
7 changed files with 269 additions and 84 deletions
+5 -1
View File
@@ -67,7 +67,11 @@
if (res.status === true){
const urlParams = new URLSearchParams(window.location.search);
if (urlParams.get("redirect")){
window.location.replace(urlParams.get("redirect"))
if (document.URL.substring(0, 5) == "http:"){
window.location.replace(`http://${urlParams.get("redirect")}`)
}else if (document.URL.substring(0, 5) == "https"){
window.location.replace(`https://${urlParams.get("redirect")}`)
}
}else{
window.location.replace("/");
}