jpwahle / cs-insights-frontend

React frontend of the cs-insights project. This is the main part of visualizing data. It uses the cs-insights-backend and cs-insights-prediction-endpoint.
MIT License
7 stars 0 forks source link

Persist login in frontend #28

Closed trannel closed 2 years ago

trannel commented 2 years ago

Is your feature request related to a problem? Please describe. Currently the login is persisted by writing it to a context during login. The token is also saved to local storage, if the user selects "remember me" during login. If you do not select "remember me" during login, any navigation outside of the website, will clear the context and the user is logged out again. The token appears to also be stored indefinitely and never be invalidated.

Describe the solution you'd like Find and implement a solution that will properly persist the login for the user using the context or in another way, both if "remember me" is checked and also if it is not checked. If local storage is deemed not viable or too insecure for this, it can be replaced. Additionally, the approach should deal with the problem of non-expiring tokens.

Describe alternatives you've considered One possible solution could involve cookies as storage solution and refresh tokens to deal with the problem of "old" tokens.

jpwahle commented 2 years ago

Done for remodeling of FE