fix: middleware traefik redirect url (#1040)
This commit is contained in:
parent
c661bc37d1
commit
9ddc1eb840
28 changed files with 84 additions and 37 deletions
|
|
@ -53,6 +53,17 @@ const loadTranslations = async (lang) => {
|
|||
}
|
||||
};
|
||||
|
||||
const getRedirectUrl = () => {
|
||||
const publicUrl = JSON.parse(
|
||||
document.getElementById("anubis_public_url").textContent,
|
||||
);
|
||||
if (publicUrl && window.location.href.startsWith(publicUrl)) {
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
return urlParams.get('redir');
|
||||
}
|
||||
return window.location.href;
|
||||
}
|
||||
|
||||
let translations = {};
|
||||
let currentLang;
|
||||
|
||||
|
|
@ -205,7 +216,7 @@ const t = (key) => translations[`js_${key}`] || translations[key] || key;
|
|||
container.innerHTML = t('finished_reading');
|
||||
|
||||
function onDetailsExpand() {
|
||||
const redir = window.location.href;
|
||||
const redir = getRedirectUrl();
|
||||
window.location.replace(
|
||||
u(`${basePrefix}/.within.website/x/cmd/anubis/api/pass-challenge`, {
|
||||
id: challenge.id,
|
||||
|
|
@ -220,7 +231,7 @@ const t = (key) => translations[`js_${key}`] || translations[key] || key;
|
|||
container.onclick = onDetailsExpand;
|
||||
setTimeout(onDetailsExpand, 30000);
|
||||
} else {
|
||||
const redir = window.location.href;
|
||||
const redir = getRedirectUrl();
|
||||
window.location.replace(
|
||||
u(`${basePrefix}/.within.website/x/cmd/anubis/api/pass-challenge`, {
|
||||
id: challenge.id,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue