SupabaseS
Supabase5mo ago
erik

Trouble with signInWithPassword in Supabase Auth — No response after call

Hi everyone,

I’m having an issue with Supabase Auth in my Ionic/React app. I’m trying to log in a user using the supabase.auth.signInWithPassword method, but it seems like the function call doesn’t return or log anything after it is called.

Here’s what I’m seeing:

  • Before calling signInWithPassword, I log a message and it appears in the console.
  • The signInWithPassword call happens, but the logs that should show the result (data and error) never appear.
  • There is no error thrown or caught.
  • No login results or errors are logged after the call.
  • I have confirmed that the Supabase client is properly initialized.
    -I’m awaiting the call properly (using await).
  • I also tried adding try/catch around the call but nothing is caught.
My code (simplified):
export const loginUser = async (email: string, password: string) => {
    console.log(":small_blue_diamond: Entering loginUser :", email, password);
    try {
        console.log("BEFORE  signInWithPassword");

        const { data, error } = await supabase.auth.signInWithPassword({
            email: email,
            password: password,
        });
        console.log("AFTERsignInWithPassword");

        console.log("Login Results: ", data, error);

        if (error) {
            ...
        } else {
            ...
        }
    } catch (error) {
        console.log("Error logging in user: ", error)
        return null;
    }
}
Was this page helpful?