hey guys! some quick questions: 1) one user just ...
# help
d
hey guys! some quick questions: 1) one user just signed up! perfect! can i verify it manual? running in my backend api for example verifyUser()? do we have such function? 2) I tried to generate a link for verify using the generateLink function like this:
Copy code
const { data: user, error } = await supabase.auth.api.generateLink({
    type: 'invite',
    email: 'test@gmail.com'
  });
But i get an error message like this:
Copy code
{
  message: 'Could not read body: json: cannot unmarshal object into Go struct field GenerateLinkParams.type of type string',
  status: 400
}

What's wrong? What's the difference beetween signup / invite? Do we have a verify type?
3) How to initialize a session when a user signIn? How the UI (React) can understand if a user is authenticated or not?
s
With regards to question 3, there's a react library which includes hooks (such as useAuthStateChange) which can let you decide what happens when a user session is started, ended, or changes: https://react-supabase.vercel.app/ (it also works on React Native)
d
thanks @Scott P 🤗