Skip to content

Example of google OAuth2 using login page outside a CRA. This uses express to save cookie session

Notifications You must be signed in to change notification settings

eric-personal/google-ouath-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Google OAuth2.0 login example

This example shows a Google Login from a separate login route outside of react. Once login has completed succesfully it closes google auth popup and routes user into react app. This adds a secure react app with google authentication using session cookies. https://google-ouath-example.herokuapp.com/

Available Scripts

Open 2 terminal windows and run both servers.

  • Express server

  • cd server

  • yarn start

  • Create React App development server

    • cd client
    • yarn start

yarn start

Run Express server to test login locally running localhost:8081.

When developing frontend React run development server Open http://localhost:3000 to view it in the browser. Note this uses CRA proxy so you will not be able to test regular routes from express only apis that are been proxied.

yarn build

Builds the app for production to the build folder.
if testing login locally using express localhost:8081 then you will need to run build evertime you make changes to React front end code.

About

Example of google OAuth2 using login page outside a CRA. This uses express to save cookie session

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published