vor marketing zu website umbenennung. stripe ist lauffähig
This commit is contained in:
@@ -13,7 +13,7 @@ interface AuthStepProps {
|
||||
export const AuthStep: React.FC<AuthStepProps> = ({ privacyHtml }) => {
|
||||
const page = usePage<{ locale?: string }>();
|
||||
const locale = page.props.locale ?? "de";
|
||||
const { isAuthenticated, authUser, markAuthenticated, nextStep, selectedPackage } = useCheckoutWizard();
|
||||
const { isAuthenticated, authUser, setAuthUser, nextStep, selectedPackage } = useCheckoutWizard();
|
||||
const [mode, setMode] = useState<'login' | 'register'>('register');
|
||||
|
||||
const handleLoginSuccess = (payload: AuthUserPayload | null) => {
|
||||
@@ -21,7 +21,7 @@ export const AuthStep: React.FC<AuthStepProps> = ({ privacyHtml }) => {
|
||||
return;
|
||||
}
|
||||
|
||||
markAuthenticated({
|
||||
setAuthUser({
|
||||
id: payload.id ?? 0,
|
||||
email: payload.email ?? "",
|
||||
name: payload.name ?? undefined,
|
||||
@@ -33,7 +33,7 @@ export const AuthStep: React.FC<AuthStepProps> = ({ privacyHtml }) => {
|
||||
const handleRegisterSuccess = (result: RegisterSuccessPayload) => {
|
||||
const nextUser = result?.user ?? null;
|
||||
if (nextUser) {
|
||||
markAuthenticated({
|
||||
setAuthUser({
|
||||
id: nextUser.id ?? 0,
|
||||
email: nextUser.email ?? "",
|
||||
name: nextUser.name ?? undefined,
|
||||
@@ -84,12 +84,14 @@ export const AuthStep: React.FC<AuthStepProps> = ({ privacyHtml }) => {
|
||||
|
||||
<div className="rounded-lg border bg-card p-6 shadow-sm">
|
||||
{mode === 'register' ? (
|
||||
<RegisterForm
|
||||
packageId={selectedPackage.id}
|
||||
privacyHtml={privacyHtml}
|
||||
locale={locale}
|
||||
onSuccess={handleRegisterSuccess}
|
||||
/>
|
||||
selectedPackage && (
|
||||
<RegisterForm
|
||||
packageId={selectedPackage.id}
|
||||
privacyHtml={privacyHtml}
|
||||
locale={locale}
|
||||
onSuccess={handleRegisterSuccess}
|
||||
/>
|
||||
)
|
||||
) : (
|
||||
<LoginForm
|
||||
locale={locale}
|
||||
|
||||
Reference in New Issue
Block a user