import { Button, Code, Paper, Text } from "@mantine/core"; import { Layout } from "../components/layouts/layout"; import { Navigate } from "react-router"; import { isQueryValid } from "../utils/utils"; import { Trans, useTranslation } from "react-i18next"; export const UnauthorizedPage = () => { const queryString = window.location.search; const params = new URLSearchParams(queryString); const username = params.get("username") ?? ""; const resource = params.get("resource") ?? ""; const { t } = useTranslation(); if (!isQueryValid(username)) { return ; } return ( {t("Unauthorized")} {isQueryValid(resource) ? ( }} values={{ resource, username }} /> ) : ( }} values={{ username }} /> )} ); };