Search code examples
javascriptreactjstypescriptruntime-errorsupabase

AuthRetryableFetchError with Supabase Auth


I've recently rewritten parts of my Supabase webapp, but something started to crash. When I call handleSignIn with the form on my site it refreshes (obviously no session is set nor any user is logged in), but for a while you can see an error - AuthRetryableFetchError. What does it mean? How to fix this? It is certainly some kind of new error for me, because I've only changed a naming and some error handling on my code. The rest of it was pretty well bug-proof so I don't know what went wrong.

const handleSignIn = async (event: any) => {

        try {
            const results = await signIn(email, password);
            console.log(results);
            if (results.error) throw results.error;
            const user: string | null | undefined = results.data.user?.email;
            alert(`Logged in as ${user}`)
            navigate("/dashboard");
        } catch (error) {
            console.error(error)
        } finally {}
    }

Edit: However, my old "reset-password" still works correctly.

const handleSubmit = async (event: any) => {
        event.preventDefault();

        if ( newPassword == confirmNewPassword ) {
            const { data, error } = await supabase.auth.updateUser
            ({
            password: newPassword,
            })
            
            console.log(error);
            console.log(data);
            
            setErrorMessage("");
            await supabase.auth.signOut() //?
            navigate("/signin");
        }
        else
        {
            setErrorMessage("Error");
        }
        if (errorMessage)
        {
            console.log(errorMessage);
        }

Thanks in advance


Solution

  • Nevermind forgot about

    event.preventDefault();