You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I encountered an issue while developing the user registration feature using the Password Provider from Convex Auth in a Next.js project. Upon submitting the registration form, the following error occurs:
Cannot read properties of null (reading 'redirect')
Additionally, the user registration data is not being submitted to the database.
Below is the relevant code from my project:
sign-up-card.tsx:
importReact,{useState}from"react";// Third-party tools/librariesimport{useAuthActions}from"@convex-dev/auth/react";// Iconsimport{TriangleAlert}from"lucide-react";import{FcGoogle}from"react-icons/fc";import{FaGithub}from"react-icons/fa";// Componentsimport{Card,CardContent,CardDescription,CardHeader,CardTitle,}from"@/components/ui/card";import{Input}from"@/components/ui/input";import{Button}from"@/components/ui/button";import{Separator}from"@/components/ui/separator";// Interface/Typesimport{SignInFlow}from"../types";interfaceSignUpCardProps{setSignType: (signType: SignInFlow)=>void;}exportconstSignUpCard=({ setSignType }: SignUpCardProps)=>{const{ signIn }=useAuthActions();const[email,setEmail]=useState("");// Emailconst[password,setPassword]=useState("");// Passwordconst[confirmPassword,setConfirmPassword]=useState("");// Confirm Passwordconst[pending,setPending]=useState(false);// Page loading stateconst[error,setError]=useState("");consthandlePasswordSignUp=(e: React.FormEvent<HTMLFormElement>)=>{e.preventDefault();if(password!==confirmPassword){setError("Passwords do not match");return;}setPending(true);signIn("password",{ email, password,flow: "signup"}).catch((e)=>console.log(e));};return(<CardclassName="w-full h-full p-8"><CardHeaderclassName="px-0 pt-0"><CardTitle>Start by signing up for an account!</CardTitle></CardHeader><CardDescriptionclassName="mb-2">
Sign up using your email or other methods
</CardDescription>{!!error&&(<divclassName="bg-destructive/15 p-3 rounded-md flex items-center gap-x-2 text-sm text-destructive mb-6"><TriangleAlertclassName="size-4"/><p>{error}</p></div>)}<CardContentclassName="space-y-5 px-0 pb-0"><formclassName="space-y-2.5"onSubmit={handlePasswordSignUp}><Inputdisabled={pending}value={email}onChange={(e)=>setEmail(e.target.value)}placeholder="Email"type="email"required/><Inputdisabled={pending}value={password}onChange={(e)=>setPassword(e.target.value)}placeholder="Password"// type="password"required/><Inputdisabled={pending}value={confirmPassword}onChange={(e)=>setConfirmPassword(e.target.value)}placeholder="Confirm Password"// type="password"required/><Buttontype="submit"className="w-full"size="lg"disabled={pending}>
Continue
</Button></form><Separator/><divclassName="flex flex-col gap-y-2.5"><ButtonclassName="w-full relative"disabled={false}// onClick={() => handleProviderSignUp("google")}variant="outline"size="lg"><FcGoogleclassName="size-5 absolute top-2.5 left-2.5"/>
Continue with Google
</Button><ButtonclassName="w-full relative"disabled={false}// onClick={() => handleProviderSignUp("github")}variant="outline"size="lg"><FaGithubclassName="size-5 absolute top-2.5 left-2.5"/>
Continue with GitHub
</Button></div><pclassName="text-xs text-muted-foreground">
Already have an account?
<spanclassName="text-sky-700 hover:underline cursor-pointer"onClick={()=>setSignType("signIn")}>
Sign In
</span></p></CardContent></Card>);};
im facing the same issue. here is snippet of my SignInCard. When click github login button, the error is showing TypeError: Cannot read properties of null (reading 'redirect')
In deployment I am getting the same error with the convex auth signIn function from useAuthActions. Works fine in local, but on deployment throws Uncaught (in promise) TypeError: Cannot read properties of null (reading 'redirect').
I encountered an issue while developing the user registration feature using the Password Provider from Convex Auth in a Next.js project. Upon submitting the registration form, the following error occurs:
Cannot read properties of null (reading 'redirect')
Additionally, the user registration data is not being submitted to the database.
Below is the relevant code from my project:
package-lock.json
:The text was updated successfully, but these errors were encountered: