feat: update authentication layout and forms for improved user experience; add new dependencies and enhance styling
All checks were successful
Build and Push Docker Images / Build and Push Docker Images (push) Successful in 5m39s

This commit is contained in:
2025-06-09 01:12:16 +05:00
parent 8438ceb376
commit 406733b360
11 changed files with 419 additions and 414 deletions

View File

@ -1,7 +1,9 @@
import { authOptions } from "@/app/auth";
import VerifyRegistrationOTPForm from "@/components/auth/verify-registration-otp-form";
import ClientErrorMessage from "@/components/client-error-message";
import { checkTempIdOrPhone } from "@/queries/authentication";
import { tryCatch } from "@/utils/tryCatch";
import { getServerSession } from "next-auth";
import { redirect } from "next/navigation";
export default async function VerifyRegistrationOTP({
@ -9,6 +11,11 @@ export default async function VerifyRegistrationOTP({
}: {
searchParams: Promise<{ phone_number: string }>;
}) {
const session = await getServerSession(authOptions)
if (session) {
// If the user is already logged in, redirect them to the home page
return redirect("/");
}
const phone_number = (await searchParams).phone_number;
if (!phone_number) {
return redirect("/login");