a3bcb464ea
- db: new password_resets table (email, userId, tokenHash, expiresAt, usedAt) - lib: password-reset-actions.ts — requestPasswordResetAction, verifyResetToken, resetPasswordAction - lib: Messaging added to createAdminClient - page: /reset-password — validates token server-side, shows form or error card - page: /forgot-password — now uses requestPasswordResetAction (custom flow) - page: /sign-in — shows success banner after ?reset=success redirect
17 lines
516 B
TypeScript
17 lines
516 B
TypeScript
import { redirect } from "next/navigation";
|
|
|
|
import { LoginForm1 } from "./components/login-form-1";
|
|
import { getCurrentUser } from "@/lib/appwrite/server";
|
|
|
|
export default async function Page({
|
|
searchParams,
|
|
}: {
|
|
searchParams: Promise<{ invite?: string; reset?: string }>;
|
|
}) {
|
|
const { invite, reset } = await searchParams;
|
|
const user = await getCurrentUser();
|
|
if (user) redirect(invite ? `/d/${invite}` : "/dashboard");
|
|
|
|
return <LoginForm1 inviteCode={invite} passwordReset={reset === "success"} />;
|
|
}
|