mirror of
https://github.com/i701/sarlink-portal.git
synced 2025-07-03 00:38:23 +00:00
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
All checks were successful
Build and Push Docker Images / Build and Push Docker Images (push) Successful in 5m39s
This commit is contained in:
@ -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");
|
||||
|
Reference in New Issue
Block a user