Giter Club home page Giter Club logo

react-universal's People

Contributors

austen-weinhart avatar by12380 avatar kevin-crawford avatar tzikas avatar vallsurf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

react-universal's Issues

Remove auto login

Remove automatically renew token and auto login prompts when visit LogIn page.
Move auto renew token feature to when login button is clicked

Update all auth methods to redux actions

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.

Setup Redux

The current React Expo has not implemented Redux.

Tasks:

  • Need to set up basic redux folder structures
  • Link components to redux

Add switch account feature for Expo, Elecetron, and React Web

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.

Completed the above feature for:

  • React Web
  • Electron
  • Expo

Get and display user profile

Story:

  • After user successfully logs in, user will be directed to Profile page showing user's name and picture.

Tasks:

  • Create get user profile actions and reducers
  • Display user profile from store onto Profile page

Add logout feature

Story:

  • After user is logged in and redirected to Profile page, there is a button for logout

Tasks:

  • Add actions and reducer for logout

Multiple login prompts show up when login button is clicked more than once

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.

Fixed issue for:

  • Electron
  • Expo

Implement login and a signed-in profile page

Story:

  • When user starts app, a login prompt is show first if not previously logged in.
  • Upon succesful login, user is redirect to a profile page (the main page) with minimal user info (name, profile pic, etc..) displayed
  • User can logout

Tasks:

  • auto login is run upon app/component start up
  • Retrieve access token from stored session to exchange for auth0 profile info
  • Create a profile page to display user profile info
  • Create a simple button for logout

Add Redux dev tool to Electron

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.

Create script to automate yarn install for all client-side project

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

Fix profile picture for Facebook login

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.

Fixed the above issue for:

  • React Web
  • Electron
  • Expo

STORE USER PROFILE IN DATABASE

Story:

  • Everytime user logs in on the client side, user's profile will be saved/updated in the database.

Tasks:

  • Set up mongo/mongoose
  • auth0 packages if necessary
  • Create backend api (/auth/login) that takes client side used_id to get auth0 user profile on the server side and store to database.

Add login and logout features

User story:

  • When user attempts to access the main page (profile page), user will be redirected to login page if not logged in
  • After user logs in the user will be redirected to the main page.

Technical flow:

  • When user attempts to access Profile page, user will be redirected to LogIn page, which will first perform an auth0 checkSession to attempt a token renewal.
    Refer to guide: https://auth0.com/docs/quickstart/spa/react/05-token-renewal

  • If checkSession fails to renew token, user will be redirected to login page for a manual login.

Tasks:

  1. Create Profile, Login, and Callback pages and setup routing
  2. Implement manual login and expect to obtain access tokens upon success.
  3. Implement checkSession for token renewals
  4. Add route guards

Update endpoint for backend update user profile

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.

Email field missing when fetch profile from auth0

When fetching profile data from auth0, user email is missing. (For all 3 client-side project)

Fix:

In login redux action, add email to the scopes array.

Ex.
Change const scopes = ['offline_access', 'openid', 'profile'];
To const scopes = ['offline_access', 'openid', 'profile', 'email'];

Issue fixed for:

  • Electron
  • React Web
  • Expo

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.