Fix error when there's no next param

This commit is contained in:
Hoang Nguyen 2023-06-23 00:16:45 +07:00
parent 8e09eec47d
commit 02fd20ee39

View file

@ -83,8 +83,8 @@
<script> <script>
function redirectNext() { function redirectNext() {
const urlParams = new URLSearchParams(window.location.search); const urlParams = new URLSearchParams(window.location.search);
const nextURL = urlParams.get('next').trim(); const nextURL = urlParams.get('next');
if (nextURL && /(?:^\/[a-zA-Z_])|(?:^\/$)/.test(nextURL)) { if (nextURL && /(?:^\/[a-zA-Z_])|(?:^\/$)/.test(nextURL.trim())) {
window.location.href = nextURL; window.location.href = nextURL;
} else { } else {
window.location.href = '/{{.basePath}}'; window.location.href = '/{{.basePath}}';