Polygon-Solutions / city-keep

CityKeep - Civic Issue Reporting App
https://www.citykeep.app
MIT License
0 stars 1 forks source link

Authentication Cleanup #13

Closed malakivandas closed 1 year ago

malakivandas commented 1 year ago

Authentication has been implemented ( #10 ), but it is messy.

Things that could be cleaned up:

  1. A state wrapper could be implemented using the ContextAPI that provides the Account state to the App.jsx component (and the rest of the components). This would reduce the clutter in the App component and also remove the prop drilling of the setAuth state handler.
  2. The asynchronous parts of the authentication code are done with Promise() and if(err){}else{} as seen in this tutorial. This could be changed to be more consistent with the rest of the asynchronous code.
  3. The Account context provider should be moved from the index.js file to the App.jsx component once the auth state has been moved out of there (see point 1 of this list).

More to come after I have a meeting with Braiden...

malakivandas commented 1 year ago

Relevant commits: All commits in PR #25

I have improved and made a custom solution for the Cognito implementation, but I still need to discuss it with Braiden to see if there is room for more improvement before making a final revision.

Improvements:

malakivandas commented 1 year ago

Completed with #35 .