Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Authentication #22

Merged
merged 31 commits into from
May 16, 2024
Merged

Authentication #22

merged 31 commits into from
May 16, 2024

Commits on May 14, 2024

  1. Adjust users controllers to perform validations and provide some cust…

    …om error messages, hash passwords before saving them to database and prevent returning the password to the client side
    Zilola-Nazarova committed May 14, 2024
    Configuration menu
    Copy the full SHA
    aad0e7d View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    e9cdf14 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    94f14dc View commit details
    Browse the repository at this point in the history
  4. Refactor Layout - create separate components Header and Navbar to inc…

    …lude <header> and <nav> elements correspondingly; make the app name in Header redirect to the HomePage; create a route for authentication and include it in Navbar
    Zilola-Nazarova committed May 14, 2024
    Configuration menu
    Copy the full SHA
    914155b View commit details
    Browse the repository at this point in the history
  5. Change state handling logic to prevent checking the value length when…

    … the data is still loading or an error was catched
    Zilola-Nazarova committed May 14, 2024
    Configuration menu
    Copy the full SHA
    7900043 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    6cf11c4 View commit details
    Browse the repository at this point in the history
  7. Create authSlice with asyncThunk that fetches user info from googleap…

    …is.com and sets it into localStorage when fulfilled, add it to Redux store
    Zilola-Nazarova committed May 14, 2024
    Configuration menu
    Copy the full SHA
    55bae67 View commit details
    Browse the repository at this point in the history
  8. Add feature to login via Google using @react-oauth/google, dispatch t…

    …he newly created getUser action (authSlice) to enable this feature
    Zilola-Nazarova committed May 14, 2024
    Configuration menu
    Copy the full SHA
    8c8eeb6 View commit details
    Browse the repository at this point in the history
  9. Add logout reducer to enable logout feature, make initialState check …

    …the localStorage so that the user stays logged in until he logs out
    Zilola-Nazarova committed May 14, 2024
    Configuration menu
    Copy the full SHA
    2542907 View commit details
    Browse the repository at this point in the history
  10. Create Profile component to show it conditionally when the user is si…

    …ned in alonside with the Sing Out button; for non-authenticated users only Login button is shown
    Zilola-Nazarova committed May 14, 2024
    Configuration menu
    Copy the full SHA
    79f6c3d View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    eec9a9d View commit details
    Browse the repository at this point in the history

Commits on May 15, 2024

  1. Create server routes for authentication and corresponding controllers…

    … (signup/signin), test the feature in Postman
    Zilola-Nazarova committed May 15, 2024
    Configuration menu
    Copy the full SHA
    c0873f5 View commit details
    Browse the repository at this point in the history
  2. Enable regular signin/signup by creating corresponding actions in aut…

    …hSlice and dispatching them in Auth component
    Zilola-Nazarova committed May 15, 2024
    Configuration menu
    Copy the full SHA
    04f15e1 View commit details
    Browse the repository at this point in the history
  3. Refactor Navbar to show the actual error message, make Profile compon…

    …ent process data coming both from google-oauth or regular signin/signup
    Zilola-Nazarova committed May 15, 2024
    Configuration menu
    Copy the full SHA
    84ae2c7 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    be21851 View commit details
    Browse the repository at this point in the history
  5. BugFix - make 'role' field in User schema of type String (instead of …

    …array), update components and forms to exlude unnecessary arrays
    Zilola-Nazarova committed May 15, 2024
    Configuration menu
    Copy the full SHA
    9b8711c View commit details
    Browse the repository at this point in the history
  6. BugFix - append back /:id to /user delete request URL and destructure…

    … it from req.params instead of req.body since we can't access req.body in delte requests
    Zilola-Nazarova committed May 15, 2024
    Configuration menu
    Copy the full SHA
    076f456 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    775d78f View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    553c27e View commit details
    Browse the repository at this point in the history
  9. Dispatch getUsers after user is registered to see results without hav…

    …ing to refresh the page after registration
    Zilola-Nazarova committed May 15, 2024
    Configuration menu
    Copy the full SHA
    34407cf View commit details
    Browse the repository at this point in the history
  10. Show only one of error messages when users couldn't be fetched and wh…

    …en there are no users in db
    Zilola-Nazarova committed May 15, 2024
    Configuration menu
    Copy the full SHA
    2d66289 View commit details
    Browse the repository at this point in the history
  11. Stop displaying users (clear the user.value in store) when the users …

    …are refetched with error or refetching is in process
    Zilola-Nazarova committed May 15, 2024
    Configuration menu
    Copy the full SHA
    2d4fa37 View commit details
    Browse the repository at this point in the history
  12. Append the token type everytime the back-end or google-auth sends the…

    … token to client since later the server will decode them differently
    Zilola-Nazarova committed May 15, 2024
    Configuration menu
    Copy the full SHA
    a01d28c View commit details
    Browse the repository at this point in the history
  13. Add interceptor to axios and extract it to a different part to be abl…

    …e to import it to all Redux slices; interceptor provides the Authorization token depending on the token type
    Zilola-Nazarova committed May 15, 2024
    Configuration menu
    Copy the full SHA
    2b3796d View commit details
    Browse the repository at this point in the history
  14. Create auth middleware on server to decode the provided token and ext…

    …ract the userId, we'll later use it to query data and restrict some actions
    Zilola-Nazarova committed May 15, 2024
    Configuration menu
    Copy the full SHA
    a8978ee View commit details
    Browse the repository at this point in the history
  15. Make App refetch all entities every time the state.auth.user changes;…

    … otherwise users have to refresh the page after registration to see the pages that require credentials
    Zilola-Nazarova committed May 15, 2024
    Configuration menu
    Copy the full SHA
    04a5f7b View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    25bd838 View commit details
    Browse the repository at this point in the history

Commits on May 16, 2024

  1. Configuration menu
    Copy the full SHA
    c625aea View commit details
    Browse the repository at this point in the history
  2. BugFix - make sure the req.userId is retrieved from auth middleware (…

    …the oauth access_token can not be decoded by jwt)
    Zilola-Nazarova committed May 16, 2024
    Configuration menu
    Copy the full SHA
    c9655a8 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    9e6ba3e View commit details
    Browse the repository at this point in the history
  4. Fix Eslint errors

    Zilola-Nazarova committed May 16, 2024
    Configuration menu
    Copy the full SHA
    86b6f73 View commit details
    Browse the repository at this point in the history