Skip to content

Commit

Permalink
Log provider session
Browse files Browse the repository at this point in the history
  • Loading branch information
Marek Miklaszewski committed Apr 27, 2023
1 parent 9687b43 commit ef15444
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions apps/next-app/src/pages/auth/provider/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,15 @@ const Provider = () => {
useEffect(() => {
const getSession = async () => {
const session = await supabase.auth.getSession();
router.replace(session ? ROUTES.DASHBOARD : ROUTES.LOGIN);
console.log('SESSION', session);
if (session) {
router.replace(ROUTES.DASHBOARD);
}
};
getSession();
}, [router, supabase.auth]);

return null;
return <div>Provider</div>;
};

export default Provider;

0 comments on commit ef15444

Please sign in to comment.