how can I use result of `Auth.useUser();` inside `...
# off-topic
n
how can I use result of
Auth.useUser();
inside
useEffect
? I have this code https://github.com/learn-anything/learn-anything/blob/main/pages/login.tsx I want to redirect users from /login page if they are already authenticated. Issue is that const { user } = Auth.useUser(); takes time to get result so inside my useEffect, user will be null always. is there a proper way to do it?
j
Asynchronous await should solve this
Have you tried that?