auth icon indicating copy to clipboard operation
auth copied to clipboard

POST /admin/generate_link returns empty string when SMTP env vars aren't set

Open kangmingtay opened this issue 4 years ago • 2 comments

Bug report

  • Missing SMTP env vars cause the POST /admin/generate_link endpoint to fail silently and return an empty string in the action_link field in the response.
  • https://github.com/supabase/gotrue/blob/aead739cfff919500cdee343496279743448bca8/api/mail.go#L145

kangmingtay avatar Nov 05 '21 05:11 kangmingtay

Not an issue in Supabase Auth (on the platform) since there's always an SMTP server. But for self-hosting, GoTrue uses the noop mailer which makes it confusing.

Adding the label good first issue if someone wants to contribute.

hf avatar Sep 21 '22 13:09 hf

What would you like to do here?

I think that https://github.com/supabase/gotrue/blob/master/internal/mailer/mailer.go#L44 should panic at this point if the configuration doesn't specify that a noop is accepted. Obviously, a new field in https://github.com/supabase/gotrue/blob/master/internal/conf/configuration.go#L192 must be added.

ifraixedes avatar Aug 15 '23 08:08 ifraixedes