Prevent XSS and Open Redirect in login page.
This commit is contained in:
parent
b9e5ddf194
commit
8e09eec47d
|
|
@ -83,8 +83,8 @@
|
|||
<script>
|
||||
function redirectNext() {
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
const nextURL = urlParams.get('next');
|
||||
if (nextURL) {
|
||||
const nextURL = urlParams.get('next').trim();
|
||||
if (nextURL && /(?:^\/[a-zA-Z_])|(?:^\/$)/.test(nextURL)) {
|
||||
window.location.href = nextURL;
|
||||
} else {
|
||||
window.location.href = '/{{.basePath}}';
|
||||
|
|
|
|||
Loading…
Reference in New Issue