Skip to content

feat: Implement User Session Persistence#19

Merged
tristenwallace merged 3 commits intomainfrom
persist_login
Apr 30, 2024
Merged

feat: Implement User Session Persistence#19
tristenwallace merged 3 commits intomainfrom
persist_login

Conversation

@tristenwallace
Copy link
Copy Markdown
Owner

Overview

This pull request introduces significant updates to the authentication flow, specifically around managing user sessions and enhancing state management with Redux. The main goal is to ensure that user sessions persist across page reloads by utilizing JWT tokens stored in local storage.

Key Changes

User Session Persistence:

  • I added logic to check for an existing authentication token in local storage on the app startup.
  • If a token exists, the application automatically dispatches an action to validate the token and fetch user details, effectively re-authenticating the user without requiring manual login.

Redux Store Enhancements:

  • I implemented fetchCurrentUser thunk in usersSlice, responsible for decoding JWT tokens and updating the user state accordingly.
  • Adjusted the Redux store setup to ensure it supports thunk actions out of the box by using the correctly typed AppDispatch.

@tristenwallace tristenwallace merged commit db4796e into main Apr 30, 2024
@tristenwallace tristenwallace deleted the persist_login branch April 30, 2024 23:19
tristenwallace pushed a commit that referenced this pull request Jul 15, 2024
# 1.0.0 (2024-07-15)

### Bug Fixes

* Immediate Update Issues for Leaderboard and PollList ([#37](#37)) ([1e76f57](1e76f57))
* Leaderboard PollSlice Import ([#10](#10)) ([8fc57da](8fc57da))
* Model associations and importing ([d9a7960](d9a7960))
* Only use random port for tests ([b5225ff](b5225ff))
* Remove jwt on logout ([#36](#36)) ([88b1ac6](88b1ac6))
* Update api integration to be aligned ([ffef1ee](ffef1ee))
* Update AWS pipeline ([#28](#28)) ([a7a33fa](a7a33fa))
* upgrade express-validator from 7.0.1 to 7.1.0 ([#50](#50)) ([7c37bae](7c37bae))
* upgrade fs from 0.0.1-security to 0.0.2 ([#49](#49)) ([668c2aa](668c2aa))
* upgrade pg from 8.11.5 to 8.12.0 ([#48](#48)) ([c814616](c814616))
* userSlice typos ([0838e1e](0838e1e))

### Features

* Add login header to Home ([0c5bb27](0c5bb27))
* Create SignupForm component ([a533c18](a533c18))
* Implement PollDetail component ([#4](#4)) ([a7dc6b7](a7dc6b7))
* Implement protected routes ([#9](#9)) ([daba7c1](daba7c1))
* Implement User Session Persistence ([#19](#19)) ([db4796e](db4796e))
* Mobile Navbar with login/signup ([e42aa31](e42aa31))
* Replace temp server with api to backend ([b564fe3](b564fe3))
* Update components to use new api ([164668d](164668d))
* Update components with updated api responses ([bf917e6](bf917e6))
* Update pollService with new api calls ([8476160](8476160))
* Update userService with new api calls ([bf9cfa6](bf9cfa6))
@tristenwallace
Copy link
Copy Markdown
Owner Author

🎉 This PR is included in version 1.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant