All Projects → bezkoder → react-redux-jwt-auth

bezkoder / react-redux-jwt-auth

Licence: other
React Redux: Token Authentication example with JWT, React Router, Axios, Thunk Middleware

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects
CSS
56736 projects

Projects that are alternatives of or similar to react-redux-jwt-auth

react-jwt-auth
React JWT Authentication & Authorization example - React.js Login and Registration example
Stars: ✭ 307 (+256.98%)
Mutual labels:  authorization, axios, jwt-authentication
Quora
Building An Exclusive Community of PEC Graduates and Students.The main features of the website are “PEC Quora” and “PEC Connect”
Stars: ✭ 26 (-69.77%)
Mutual labels:  react-redux, axios, jwt-authentication
trivin
⚡️Setup your entire project quickly and easily with 1-line command ⚡️
Stars: ✭ 58 (-32.56%)
Mutual labels:  react-redux, axios
react-movies-finder
React Movies finder is a React app to search movies and series using redux, redux-thunk, React Hooks, and Material UI
Stars: ✭ 27 (-68.6%)
Mutual labels:  react-redux, axios
React Cloud Music
React 16.8打造精美音乐WebApp
Stars: ✭ 1,722 (+1902.33%)
Mutual labels:  react-redux, axios
boss
React+express+sock.io+mongodb build a boss
Stars: ✭ 25 (-70.93%)
Mutual labels:  react-redux, axios
Covid19-Stats-IN
This app helps in tracking COVID-19 cases in India using covid19India apis
Stars: ✭ 13 (-84.88%)
Mutual labels:  react-redux, axios
React Login
A client side implementation of authentication using react.js for my blog on medium. This is the second part of my previous blog on how to implement scalable node.js server.
Stars: ✭ 105 (+22.09%)
Mutual labels:  react-redux, jwt-authentication
Spotify Clone Client
A ReactJS clone application of the popular Spotify music streaming service. This application utilizes the Spotify API and the Spotify Web Playback SDK
Stars: ✭ 162 (+88.37%)
Mutual labels:  authorization, axios
React Ant Admin
使用 ant-design react react-hook ts 开发的类 ant-design-pro 管理后台,具有完整的权限系统和配套的node + ts 的 api
Stars: ✭ 199 (+131.4%)
Mutual labels:  react-redux, axios
React Blog
personal blog design by react
Stars: ✭ 170 (+97.67%)
Mutual labels:  react-redux, axios
role-based-access-control
Role-based authorization || Role-based access-control in React.js
Stars: ✭ 111 (+29.07%)
Mutual labels:  react-redux, authorization
energy-use-case-trading-client
Energy Use Case Web UI for Lition Trading Platform
Stars: ✭ 23 (-73.26%)
Mutual labels:  react-redux, axios
laravel-react-boilerplate
Laravel React Boilerplate with Ant Design, Route-Level Code Splitting, Redux, Sanctum Auth
Stars: ✭ 49 (-43.02%)
Mutual labels:  react-redux, axios
Oauthlib
A generic, spec-compliant, thorough implementation of the OAuth request-signing logic
Stars: ✭ 2,323 (+2601.16%)
Mutual labels:  authorization, jwt-authentication
React Antd Admin Template
一个基于React+Antd的后台管理模版,在线预览https://nlrx-wjc.github.io/react-antd-admin-template/
Stars: ✭ 1,022 (+1088.37%)
Mutual labels:  react-redux, axios
Caddy Auth Jwt
JWT Authorization Plugin for Caddy v2
Stars: ✭ 127 (+47.67%)
Mutual labels:  authorization, jwt-authentication
Express Mongodb Rest Api Boilerplate
A boilerplate for Node.js apps / Rest API / Authentication from scratch - express, mongodb (mongoose).
Stars: ✭ 153 (+77.91%)
Mutual labels:  authorization, jwt-authentication
Ecommerce Reactjs
Full stack ecommerce online store application
Stars: ✭ 164 (+90.7%)
Mutual labels:  react-redux, axios
kugou
multiple implementations for kugou music
Stars: ✭ 25 (-70.93%)
Mutual labels:  react-redux, axios

React Redux JWT Authentication & Authorization example

Build a React Redux Token Authentication example with JWT, LocalStorage, React Router, Axios and Bootstrap:

  • JWT Authentication Flow for User Signup & User Login
  • Project Structure for React Redux JWT Authentication, LocalStorage, Router, Axios
  • Working with Redux Actions, Reducers, Store for Application state
  • Creating React Components with Form Validation
  • React Components for accessing protected Resources (Authorization)
  • Dynamic Navigation Bar in React App

User Registration and User Login Flow

For JWT Authentication, we’re gonna call 2 endpoints:

  • POST api/auth/signup for User Registration
  • POST api/auth/signin for User Login

The following flow shows you an overview of Requests and Responses that React Client will make or receive. This React Client must add a JWT to HTTP Header before sending request to protected resources.

react-jwt-authentication-flow

For more detail, please visit:

React Redux JWT Authentication & Authorization example

React - How to Logout when Token is expired

React Hooks + Redux: JWT Authentication & Authorization example

React JWT Authentication & Authorization (without Redux) example

This project was bootstrapped with Create React App.

Set port

.env

PORT=8081

Note:

Open src/services/auth-header.js and modify return statement for appropriate back-end (found in the tutorial).

export default function authHeader() {
  const user = JSON.parse(localStorage.getItem('user'));

  if (user && user.accessToken) {
    // return { Authorization: 'Bearer ' + user.accessToken }; // for Spring Boot back-end
    return { 'x-access-token': user.accessToken };             // for Node.js Express back-end
  } else {
    return {};
  }
}

Project setup

In the project directory, you can run:

npm install
# or
yarn install

or

Compiles and hot-reloads for development

npm start
# or
yarn start

Open http://localhost:8081 to view it in the browser.

The page will reload if you make edits.

Related Posts

In-depth Introduction to JWT-JSON Web Token

React.js CRUD example to consume Web API

React Redux CRUD App example with Rest API

React Pagination example

React File Upload with Axios and Progress Bar to Rest API

Fullstack (JWT Authentication & Authorization example):

React + Spring Boot

React + Node.js Express

Fullstack CRUD with Node.js Express:

React.js + Node.js Express + MySQL

React.js + Node.js Express + PostgreSQL

React.js + Node.js Express + MongoDB

Fullstack CRUD with Spring Boot:

React.js + Spring Boot + MySQL

React.js + Spring Boot + PostgreSQL

React.js + Spring Boot + MongoDB

Fullstack CRUD with Django:

React.js + Django Rest Framework

Integration (run back-end & front-end on same server/port)

How to integrate React.js with Spring Boot

Integrate React with Node.js Express on same Server/Port

Serverless:

React Firebase CRUD App with Realtime Database

React Firestore CRUD App example | Firebase Cloud Firestore

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].