auth
auth copied to clipboard
POST /admin/generate_link returns empty string when SMTP env vars aren't set
Bug report
- Missing SMTP env vars cause the
POST /admin/generate_linkendpoint 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
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.
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.