Currently all the basic auth functions (Login, Logout, etc..) exist in service/authService.js and are not in the form of redux actions. Need to update them as redux actions + reducers.
Currently the login button will directly log user in with the first account that the user has used to log in on the first time (despite having logout and login again). Will need to create a separate button that allows switching account.
Details:
Create a 'Switch account' button placed in the Profile page.
Create redux action and reducer for 'switch account' functionality. (Copy and reuse the login action creators in its respective project and simply append prompt=login as a parameter in the login settings/options.
In both the Expo and Electron project, when the login button is clicked the second time during a slight delay before the first login prompt pops-up from the first click, it triggers and shows two login prompt in the end. (Expo app explicitly gives warning)
Potential fix:
Perhaps disable the login button right after the first click and enable button again after the login prompt exits (whether the user successfully logs in or quits login prompt).
Or
A loading overlay page that prevents user from clicking any buttons while the login proccess is in progress.
Suggesstion: Use loginPending redux state to enable and disable the loading feature.
Currently in development mode Redux dev tool has not been set up for the Electron project so there is not way of inspecting redux states for the app during development. Some googling is needed to see how to setup this up.
It is preferred to have a npm/yarn script at the repo's root directory (/react-universal) that can be run where it automatically runs the yarn command for all three client projects (React, Electron, Expo) under each of their root directory.
Suggestions:
Create a new package.json file at the project's root directory (/react-universal)
Call the script's command name something like install
When logged in using facebook account, the profile picture returned by facebook and displayed on the Profile page appears low quality and need to be resized accordingly.
Check to see if there is a way to detect dimensions of the returned image link and dynamically resize the image when displayed at the Profile page, suitable for all future cases when different social logins are used.
Change profile/update-with-auth0 endpoint to a more generic user/update accepting a full user object to store in database, instead of fetching user profile from a specific auth provider.
This allows the our app to be overall more generic and not tied to auth0.
In Expo project, after user clicks 'switch account' and successfully re-logsin using another account, profile page does not display an updated profile info.