supabase icon indicating copy to clipboard operation
supabase copied to clipboard

Code doesn't proceed past the supabase.auth.updateUser function

Open phillipmohr opened this issue 2 years ago • 2 comments
trafficstars

Not sure if this is a bug.

I have password reset form.

  1. User enters his email
  2. receives the verification link via email
  3. form where he can reset his password
  4. then, I call this function await supabase.auth.updateUser({ password: updatePasswordForm.password })

The password gets successfully changed, however, the code after this doesn't proceed past the supabase.auth.updateUser function. There are no errors in the console or network tab...

Why is that?

const handleSubmit = async () => {
        if (updatePasswordForm.password !== updatePasswordForm.passwordConfirmation) {
            return alert('Passwords do not match')
        }

        try {
            loading.value = true

            console.log('getting here')
            console.log(updatePasswordForm.password)

            const { data, error } = await supabase.auth.updateUser({ password: updatePasswordForm.password })

            console.log('not getting here')

            if (error) throw error

            navigateTo('/forgot-password/success')

        } catch (error) {
            console.log('not getting here')
            alert(error.error_description || error.message)
        } finally {
            console.log('not getting here')
            loading.value = false
        }
    }

"@nuxtjs/supabase": "0.3.8", "node_modules/@nuxtjs/supabase": { "version": "0.3.8", "resolved": "https://registry.npmjs.org/@nuxtjs/supabase/-/supabase-0.3.8.tgz", "integrity": "sha512-MEhfgllJx7DQX4XrycGbnTmiW6JI1wLTaVTkDV9X90q+jfBz59d/uM2E6aj4XhLuJp4GN/THGpMg8k1RfuYxqQ==", "dependencies": { "@nuxt/kit": "^3.6.1", "@supabase/supabase-js": "2.26.0", "defu": "^6.1.2", "pathe": "^1.1.1" } },

EDIT: I'm getting this warning. Could it be because of that? Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key. I know this warning gets fixed with 1.0.0, however, there is a major bug in 1.0.0 which is why I haven't updated yet.

phillipmohr avatar Sep 22 '23 03:09 phillipmohr

Any updates on this? Or am I the only one experiencing this issue?

phillipmohr avatar Oct 08 '23 02:10 phillipmohr

@phillipmohr I do have the same issues. Password is changing but code doesn't proceed and not throwing any error.

RobertWade avatar Oct 11 '23 06:10 RobertWade