Open hemanth-gopi opened 4 months ago
Facing the same issue. Have you every found a fix for that?
There is a client method called updateAuthSession. You can use that to update the token and authenticate the fields inside the client
// Validate the token
session := types.Session{}
session.AccessToken = token
client.UpdateAuthSession(session)
Works like a charm! Thanks! They really should update the documentation.
I have the same problem. The workaround is working.
Auth is not initialised with User Token
Whenever you create a new Client using supabase.NewClient() and by passing custom headers with the Authorisation token, the Auth field is not initialized with the same token.
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
Initialize the supabase Client as follows with the user token
Now when you want to access the User object, you intend to use the following snippet
user, err := client.Auth.GetUser()
But this will lead to the following error
Expected behavior
A user object should be obtained with user details using the token passed during initialization of superbase client
System information
OS: [e.g. Windows]
github.com/supabase-community/functions-go v0.0.0-20220927045802-22373e6cb51d // indirect
github.com/supabase-community/gotrue-go v1.2.0 // indirect
github.com/supabase-community/postgrest-go v0.0.11 // indirect
github.com/supabase-community/storage-go v0.7.0 // indirect
github.com/supabase-community/supabase-go v0.0.4 // indirect
Additional context
Add any other context about the problem here.