hiyaryan / the-cdj

The Cognitive Distortion Journal (CDJ) is a smart journaling tool that helps remedy distorted thinking. It can feel impossible to follow the CBT technique of labeling distorted thinking and finding alternative modes of thought (i.e. reframing) while cognitive distortions are occurring. The CDJ does that work for you. -- The CDJ is in beta testing!!
https://thecdj.app
3 stars 0 forks source link

Setup session for user authentication. #13

Closed hiyaryan closed 9 months ago

hiyaryan commented 9 months ago

This PR sets up session for user authentication. It adds the functionality to know that a user is logged in which is a requirement to view entries. It also provides the ability for users to log out. This is done using a custom isAuthenticated middleware on login and entries routes and passports isAuthenticated and logout methods added to the req body.

The Logout component has been updated to with respect to this new functionality.

The useNavigate hook is now used to navigate the user around the React app as opposed to window.location that reloads the entire react app. useNavigate seamlessly redirects the user around the app.

Environment variables are now being used in development.