Skip to content
This repository has been archived by the owner on Jun 23, 2024. It is now read-only.

Commit

Permalink
feat: only allow relative redirects
Browse files Browse the repository at this point in the history
  • Loading branch information
uhidontkno committed Apr 20, 2024
1 parent fb8c013 commit 01d9b6b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions static/modules/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ async function loginForm() {
localStorage["DEBLOKAUTH"] = await res.text();
let redirect = new URLSearchParams(window.location.search).get("redirect_to") || "/"
document.location =
redirect.replaceAll("javascript","");
redirect.replaceAll("javascript","").replaceAll("http:","").replaceAll("https:","");
} else {
alert(await res.text());
usrPwd.value = "";
Expand All @@ -181,7 +181,7 @@ async function signupForm() {
localStorage["DEBLOKAUTH"] = await lres.text();
let redirect = new URLSearchParams(window.location.search).get("redirect_to") || "/"
document.location =
redirect.replaceAll("javascript","");
redirect.replaceAll("javascript","").replaceAll("http:","").replaceAll("https:","");

}
} else {
Expand Down

0 comments on commit 01d9b6b

Please sign in to comment.