Open garyditsch opened 7 months ago
https://supabase.com/docs/reference/javascript/auth-getuser
This method fetches the user object from the database instead of local session. This method is useful for checking if the user is authorized because it validates the user's access token JWT on the server. Should be used only when you require the most current user data. For faster results, getSession().session.user is recommended.
const { data: { user } } = await supabase.auth.getUser()
Loaders on _main/index and _main/index/edit are updated, need to update actions on both. Still need the redirect as part of the check to... need to decide if loaders and actions need checked, only because there us the user check at the layout (probably does because the loaders create the api endpoint which can still be reached)
did some additional refactoring with readingUserSession and now should have all of the main and main/edit routes updated.
Have the calendar view, daily view and daily edit view updated.
All loaders and actions should be updated
https://supabase.com/docs/reference/javascript/auth-getsession
const { data, error } = await supabase.auth.getSession()