// // Copyright (c) 2025 rustmailer.com (https://rustmailer.com) // // This file is part of the Bichon Email Archiving Project // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . import { Card, CardHeader, CardContent } from "@/components/ui/card"; import { FixedHeader } from "@/components/layout/fixed-header"; import { Main } from "@/components/layout/main"; import { useLocation } from "@tanstack/react-router"; import { AlertCircle, CheckCircle2, Info } from "lucide-react"; import { Button } from "@/components/ui/button"; import { useTranslation } from "react-i18next"; export default function OAuth2Result() { const { t } = useTranslation(); const { search } = useLocation(); const params = new URLSearchParams(search); const error = params.get("error"); const message = params.get("message"); const success = params.get("success"); return ( <>
{error ? (

{t('oauth2.authFailed')}

{t('oauth2.error')}

{message?.replace(/\\n/g, "\n").replace(/\\"/g, "") || t('oauth2.unknownError')}
) : success ? (

{t('oauth2.authSuccess')}

{t('oauth2.success')}

{t('oauth2.successMessage')}
) : (

{t('oauth2.authStatus')}

{t('oauth2.information')}

{t('oauth2.noStatus')}
)}
); }