fix: redirect vulnerability on error, sign in and totp page

This commit is contained in:
Elias Schneider
2024-04-05 12:00:41 +02:00
parent 9d1a12b0d1
commit 384fd19203
4 changed files with 20 additions and 8 deletions

View File

@@ -4,6 +4,7 @@ import Meta from "../components/Meta";
import useTranslate from "../hooks/useTranslate.hook";
import { useRouter } from "next/router";
import { FormattedMessage } from "react-intl";
import { safeRedirectPath } from "../utils/router.util";
const useStyle = createStyles({
title: {
@@ -39,7 +40,9 @@ export default function Error() {
</Text>
<Button
mt="xl"
onClick={() => router.push((router.query.redirect as string) || "/")}
onClick={() =>
router.push(safeRedirectPath(router.query.redirect as string))
}
>
{t("error.button.back")}
</Button>