nedpals / supabase-go

Unofficial Supabase client library for Go.
https://pkg.go.dev/github.com/nedpals/supabase-go
MIT License
380 stars 73 forks source link

Provision redirectTo for the go sdk #52

Closed saintmalik closed 4 months ago

saintmalik commented 5 months ago

is it possible to pass the redirectTO parameter for the signup confirmation mail sent by supabase just like its done in the js syntax

async function signUpNewUser() { const { data, error } = await supabase.auth.signUp({ email: 'example@email.com', password: 'example-password', options: { emailRedirectTo: 'https://example.com/welcome', }, }) }

emilkm commented 5 months ago

Hi @saintmalik

I recently added ResetPasswordForEmailWithRedirectUrl method to my fork

https://github.com/emilkm/supabase-go/tree/recover_redirect_to

and seeing your comment, just added SignUpWithRedirectUrl, plus a couple of small fixes.

Method of calling SignUpWithRedirectUrl is not the same syntax as the TypeScript/JS client. I followed the pattern of the library, and that by another contributor that recently added InviteUserByEmailWithData

So you still have the existing SignUp method, and a new SignUpWithRedirectUrl method, with redirectTo being the last parameter.

Library is small enough so you can easily stick the folder into your project to test if it works.

Haven't tested extensively, but a quick one works for me.

image

saintmalik commented 4 months ago

thanks for this @emilkm , i will give it a try in my next project