diff --git a/actions/auth-actions.ts b/actions/auth-actions.ts
index 961c3a3..d671073 100644
--- a/actions/auth-actions.ts
+++ b/actions/auth-actions.ts
@@ -15,6 +15,10 @@ export type FilterUserResponse = {
ok: boolean;
verified: boolean;
};
+export type FilterTempUserResponse = {
+ ok: boolean;
+ otp_verified: boolean;
+};
export async function signin(previousState: ActionState, formData: FormData) {
const phoneNumber = formData.get("phoneNumber") as string;
diff --git a/app/(auth)/auth/verify-otp-registration/page.tsx b/app/(auth)/auth/verify-otp-registration/page.tsx
index d712bf4..ee6f497 100644
--- a/app/(auth)/auth/verify-otp-registration/page.tsx
+++ b/app/(auth)/auth/verify-otp-registration/page.tsx
@@ -1,5 +1,6 @@
import VerifyRegistrationOTPForm from "@/components/auth/verify-registration-otp-form";
-import { checkIdOrPhone } from "@/queries/authentication";
+import ClientErrorMessage from "@/components/client-error-message";
+import { checkIdOrPhone, checkTempIdOrPhone } from "@/queries/authentication";
import { tryCatch } from "@/utils/tryCatch";
import Image from "next/image";
import { redirect } from "next/navigation";
@@ -18,12 +19,14 @@ export default async function VerifyRegistrationOTP({
"phone number from server page params (verify otp page)",
phone_number,
);
- const [error, response] = await tryCatch(checkIdOrPhone({ phone_number }));
+ const [error, response] = await tryCatch(
+ checkTempIdOrPhone({ phone_number }),
+ );
if (error) {
console.log("Error in checkIdOrPhone", error);
- return redirect("/auth/signin");
+ return