October 31, 2022
React Express Authentication
Implement authentication in a React and Express app using JWT, integrate Google OAuth2, and manage state with Redux Toolkit.
React Express Authentication
This is a simple authentication with ReactJS and ExpressJS. This project is using JWT for authentication (Access Token and Refresh Token) and OAuth2 with Google for authorization. This project is also using Redux Toolkit for state management.
Using the new Google Identity Services for Web (GSI) for authentication.
Live demo : Not available yet.
Source code : GitHub
Features
- Authentication with Google OAuth2
Tech Stack
Prerequisites
Installation and Usage
Clone the repository
cd to the project directory
cd into the client directory & express directory
Install dependencies for client & express
Copy .env.example
to .env
for both client & express
Configure the .env
file for both client & express
Get the Google Client ID and Google Client Secret from Google Cloud Platform. Then, paste to the following environment variable in the .env
file.
Create a database
Run the migration
Run the client & express