nikivi
09/03/2021, 3:55 PMAuth.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?jon.m
09/04/2021, 3:40 AMjon.m
09/04/2021, 3:40 AM