auth-js icon indicating copy to clipboard operation
auth-js copied to clipboard

"User with this email not found" error when using generateLink

Open jide opened this issue 1 year ago • 8 comments

Bug report

  • [X] I confirm this is a bug with Supabase, not with my own application.
  • [X] I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug

In local development, everything works fine:

  const { data, error } = await supabaseService.auth.admin.generateLink({
    type: "signup",
    email,
    password,
  });

Works as expected.

In production, it throws "User with this email not found". I triple checked, email and password are legit non-existing values.

To Reproduce

I'm unable to reproduce this as local dev works as expected :(

Expected behavior

I really do not see how this error can be thrown by the generateLink() function.

System information

  • OS: local dev : macOS
  • Version of supabase-js: 2.39.7
  • Version of Node.js: 20

jide avatar Apr 02 '24 22:04 jide

Ok, I reproduced this, and I confirm this is a bug recently introduced.

It basically breaks signups for apps where an email is sent using generateLink(), which is really bad.

To reproduce:

  • Create a supabase project
  • Clone this repository
  • Set env vars
  • Launch node index.js
  • It throws AuthApiError: User with this email not found

https://github.com/jide/supabase-issue-875

jide avatar Apr 03 '24 07:04 jide

The issue has been fixed.

Capture d’écran 2024-04-04 à 00 37 52

jide avatar Apr 03 '24 22:04 jide

I'm also experiencing this issue. Any solutions? Do I need to update my Supabase Postgres version?

ham-evans avatar Apr 08 '24 18:04 ham-evans

Reopening to bring supabase maintainers attention.

jide avatar Apr 08 '24 19:04 jide

Currently experiencing something similar, but using "invite" type when generating a link.

For local development, all is well, but in github actions the following is failing with [AuthApiError]: User with this email not found

const { data, error } = await supabase.auth.admin.generateLink({
  type: 'invite',
  email
})

System information:

@supabase/supabase-js 2.39.3

node-version: 18.19.1

Operating System Ubuntu 22.04.4 LTS

vacas5 avatar Apr 16 '24 21:04 vacas5

Edit: @frschi suggestion to upgrade GoTrue resolved the issue for me

Facing same issue on Local

  const link = await supabase.auth.admin.generateLink({
    type: 'signup',
    email,
    password
  });

Is giving the following error

error: AuthApiError: User with this email not found

App https://esm.sh/@supabase/[email protected]?target=deno supabase-edge-runtime-1.45.2 (compatible with Deno v1.40.3)

Supabase GoTrue version: 2.145.0 PostgREST version: 12.0.1 Postgres version: 15.1.0.1417

tech-betastreets avatar Apr 27 '24 08:04 tech-betastreets

I had the same issue in my local supabase docker. At the time writing this comment, the docker-compose.yml in the official supabase repo docker folder, the auth service (supabase/gotrue) has verison: v2.145.0, i updated it to the latest version on docker hub which is supabase/gotrue:v2.150.1 and the problem was solved. @tech-betastreets so from your comment it seems like your GoTrue version is too old

frschi avatar Apr 29 '24 22:04 frschi

For my issue, the reason that it was working for local development but not in Github actions is because locally we were using v1.153.4 of supabase cli, which was installing v2.130.0 of gotrue. When I set my action to the following the issue resolved.

- name: Setup Supabase
        uses: supabase/setup-cli@v1
        with:
          version: 1.153.4

I have yet to try upgrading to the latest version of the CLI.

vacas5 avatar Apr 30 '24 19:04 vacas5

@vacas5 upgrading the CLI upgrades the auth service's docker image version used which should contain the fix

kangmingtay avatar May 03 '24 10:05 kangmingtay