garyditsch / three-sixity-five

Daily tracker for goals
0 stars 0 forks source link

Loaders and actions need to be reviewed to verify they all check for user prior to any execution #65

Open garyditsch opened 7 months ago

garyditsch commented 7 months ago

https://supabase.com/docs/reference/javascript/auth-getsession

const { data, error } = await supabase.auth.getSession()

garyditsch commented 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()

garyditsch commented 7 months ago

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)

garyditsch commented 7 months ago

did some additional refactoring with readingUserSession and now should have all of the main and main/edit routes updated.

garyditsch commented 7 months ago

Have the calendar view, daily view and daily edit view updated.

garyditsch commented 7 months ago

All loaders and actions should be updated