mirror of
https://github.com/i701/sarlink-portal.git
synced 2025-07-01 03:05:55 +00:00
feat: update signup and OTP verification forms to enhance error handling and state management
All checks were successful
Build and Push Docker Images / Build and Push Docker Images (push) Successful in 4m16s
All checks were successful
Build and Push Docker Images / Build and Push Docker Images (push) Successful in 4m16s
This commit is contained in:
@ -34,6 +34,9 @@ export default function SignUpForm() {
|
||||
|
||||
const [actionState, action, isPending] = React.useActionState(signup, {
|
||||
message: "",
|
||||
db_error: "",
|
||||
errors: undefined,
|
||||
payload: new FormData(),
|
||||
});
|
||||
|
||||
React.useEffect(() => {
|
||||
|
@ -4,11 +4,9 @@ import { Button } from "@/components/ui/button";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { Label } from "@/components/ui/label";
|
||||
import { VerifyRegistrationOTP } from "@/queries/authentication";
|
||||
import { zodResolver } from "@hookform/resolvers/zod";
|
||||
import { Loader2 } from "lucide-react";
|
||||
import { signIn } from "next-auth/react";
|
||||
import Link from "next/link";
|
||||
import { redirect, useRouter, useSearchParams } from "next/navigation";
|
||||
import { redirect, useSearchParams } from "next/navigation";
|
||||
import { useActionState } from "react";
|
||||
|
||||
export default function VerifyRegistrationOTPForm({
|
||||
@ -42,7 +40,6 @@ export default function VerifyRegistrationOTPForm({
|
||||
type="number"
|
||||
name="mobile"
|
||||
defaultValue={phone_number}
|
||||
value={phone_number}
|
||||
hidden
|
||||
/>
|
||||
<Input
|
||||
|
Reference in New Issue
Block a user