"use client"; import BackgroundWrapper from "@/components/BackgroundWrapper"; import Header from "@/components/Header"; import { InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, } from "@/components/ui/input-otp"; import { API_URL } from "@/lib/auth"; import Image from "next/image"; import React, { useState } from "react"; const VerificationScreen = () => { const [otp, setOtp] = useState(""); const [loading, setLoading] = useState(false); const [error, setError] = useState(null); const handleVerify = async () => { if (otp.length < 6) return; setLoading(true); setError(null); try { const response = await fetch(`${API_URL}/auth/verify?code=${otp}`, { method: "GET", headers: { "Content-Type": "application/json", }, }); const data = await response.json(); if (!response.ok) { throw new Error(data.message || "Verification failed"); } // 🔥 Call zustand action to update auth state } catch (err: any) { setError(err.message); } finally { setLoading(false); } }; return (
otp-banner

Enter the code here that you received in your email.

{error &&

{error}

}
); }; export default VerificationScreen;