mirror of
https://github.com/i701/sarlink-portal.git
synced 2025-07-02 03:38:22 +00:00
feat: implement checkTempIdOrPhone function and update OTP verification logic
Some checks failed
Build and Push Docker Images / Build and Push Docker Images (push) Failing after 1m29s
Some checks failed
Build and Push Docker Images / Build and Push Docker Images (push) Failing after 1m29s
This commit is contained in:
@ -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 <ClientErrorMessage message={error.message} />;
|
||||
}
|
||||
if (response.verified) redirect("/auth/signin");
|
||||
if (response.otp_verified) redirect("/auth/signin");
|
||||
return (
|
||||
<div className="bg-gray-100 dark:bg-black w-full h-screen flex items-center justify-center font-sans">
|
||||
<div className="flex flex-col items-center justify-center w-full h-full ">
|
||||
|
Reference in New Issue
Block a user