diff --git a/shop/app/auth/verify-link/page.tsx b/shop/app/auth/verify-link/page.tsx new file mode 100644 index 0000000..275f270 --- /dev/null +++ b/shop/app/auth/verify-link/page.tsx @@ -0,0 +1,76 @@ +'use client'; + +import { use, useState } from "react"; +import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; +import { Button } from "@/components/ui/button"; +import { ShieldCheck, Loader2 } from "lucide-react"; + +interface PageProps { + searchParams: Promise<{ + token_hash?: string; + type?: string; + next?: string; + }>; +} + +export default function VerifyLinkPage({ searchParams }: PageProps) { + const params = use(searchParams); + const [isSubmitting, setIsSubmitting] = useState(false); + + const tokenHash = params.token_hash || ""; + const type = params.type || ""; + const next = params.next || "/"; + + const handleSubmit = () => { + setIsSubmitting(true); + }; + + return ( +
+ {/* Background gradients for rich aesthetics */} +
+
+
+ +
+ + +
+ +
+
+ + Sicherheit prüfen + +

+ Bitte bestätigen Sie den Vorgang mit einem Klick auf den Button, um fortzufahren. +

+
+
+ +
+ + + + + +
+
+
+
+
+ ); +} diff --git a/shop/lib/actions/users.ts b/shop/lib/actions/users.ts index 1378fbe..9cb7895 100644 --- a/shop/lib/actions/users.ts +++ b/shop/lib/actions/users.ts @@ -84,7 +84,7 @@ export async function createUser(data: { email: string; role?: 'admin' | 'partne const tokenHash = (linkData as any)?.properties?.hashed_token; if (tokenHash) { const siteUrl = process.env.NEXT_PUBLIC_SITE_URL || 'https://staging.hephex.de'; - const setupLink = `${siteUrl}/auth/confirm?token_hash=${tokenHash}&type=recovery&next=/auth/update-password`; + const setupLink = `${siteUrl}/auth/verify-link?token_hash=${tokenHash}&type=recovery&next=/auth/update-password`; await sendMail({ to: data.email, subject: 'Willkommen bei CASPOS Shop – Ihr Benutzerkonto wurde erstellt', @@ -183,7 +183,7 @@ export async function resetPassword(email: string) { if (!tokenHash) throw new Error('Recovery token not generated'); // Build link pointing to our own /auth/confirm route const siteUrl = process.env.NEXT_PUBLIC_SITE_URL || 'https://staging.hephex.de'; - const resetLink = `${siteUrl}/auth/confirm?token_hash=${tokenHash}&type=recovery&next=/auth/update-password`; + const resetLink = `${siteUrl}/auth/verify-link?token_hash=${tokenHash}&type=recovery&next=/auth/update-password`; await sendMail({ to: email, subject: 'Passwort zurücksetzen',