How to get user data when signing in with onSuccess?
I want to track when a user has signed in and who has signed in for analytics. My analytics tool works only on the client side. That's why I need to use the onSuccess callback like this:
Is there any way to get the current user inside the function? or is there a better option? The CTX context only returns the following:
Is there any way to get the current user inside the function? or is there a better option? The CTX context only returns the following:
Solution
You can just call
authClient.getSesion inside the onSuccess callback to grab user info, then pass it to your analytics APIs.