import { Card, CardContent } from '@components/common/ui/Card.js'; import { toast } from '@components/common/ui/Sonner.js'; import { CustomerLoginForm } from '@components/frontStore/customer/LoginForm.js'; import { _ } from '@evershop/evershop/lib/locale/translate/_'; import React from 'react'; interface LoginPageProps { homeUrl: string; registerUrl: string; forgotPasswordUrl: string; } export default function LoginPage({ homeUrl, registerUrl, forgotPasswordUrl }: LoginPageProps) { // Return the shopper to `?redirect=` after login (e.g. back to checkout when guest // checkout is disabled). Only same-site relative paths are honoured (no open redirects). const [redirectUrl, setRedirectUrl] = React.useState(homeUrl); React.useEffect(() => { const redirect = new URLSearchParams(window.location.search).get('redirect'); if (redirect && redirect.startsWith('/') && !redirect.startsWith('//')) { setRedirectUrl(redirect); } }, []); return (