You are probably getting your user variable you u...
# javascript
g
You are probably getting your user variable you use in the code, before the signIn is actually finished. auth.user() will be null before signIn is completed.
s
Ah gotcha, yes I suspect that is the case, thanks for pointing it out! Is there any easy workaround?
g
It varies so much with the coding environment you are using, but you have not not use auth.user() or detect it is null and wait/error/signin before your user as completed signIn. I usually use console.log near the user() and signIn logic to see if the order is messed up. There are examples for a few environments on the Supabase page.