// This file is part of Shadcn Admin Kit (https://github.com/marmelab/shadcn-admin-kit) import { Link } from "react-router"; import { Translate, useHandleAuthCallback, useTranslate } from "ra-core"; import { CircleAlert, LockIcon } from "lucide-react"; import { cn } from "@/lib/utils"; import { Button } from "@/components/ui/button"; import { Loading } from "@/components/admin/loading"; /** * A standalone page to be used in a route called by external authentication services (e.g. OAuth) * after the user has been authenticated. * * Copy and adapt this component to implement your own login logic * (e.g. to show a different waiting screen, start onboarding procedures, etc.). * * @example * import MyAuthCallbackPage from './MyAuthCallbackPage'; * const App = () => ( * * ... * * ); */ export const AuthCallback = () => { const { error } = useHandleAuthCallback(); if (error) { return ( ); } return ; }; export interface AuthErrorProps { className?: string; title?: string; message?: string; } export const AuthError = (props: AuthErrorProps) => { const { className, title = "ra.page.error", message = "ra.message.auth_error", ...rest } = props; const translate = useTranslate(); return (

{translate(message, { _: message })}

); };