8000 GitHub - skillsapphire/react-redux-hooks-jwt-auth: React Redux Login, Logout, Registration example using Hooks, JWT, Local Storage, React Router, Thunk Middleware, Axios, Bootstrap
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

React Redux Login, Logout, Registration example using Hooks, JWT, Local Storage, React Router, Thunk Middleware, Axios, Bootstrap

Notifications You must be signed in to change notification settings

skillsapphire/react-redux-hooks-jwt-auth

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React Redux Login, Logout, Registration example using Hooks

73CE

For more detail, please visit:

React Redux Login, Logout, Registration example with Hooks

React Hooks: JWT Authentication & Authorization (without Redux) example

React Redux Login, Logout, Registration example (using React Components)

Related Posts:

In-depth Introduction to JWT-JSON Web Token

React.js CRUD example to consume Web API

React File Upload with Axios and Progress Bar to Rest API

Fullstack (JWT Authentication & Authorization example):

React + Spring Boot

React + Node.js Express

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.

About

React Redux Login, Logout, Registration example using Hooks, JWT, Local Storage, React Router, Thunk Middleware, Axios, Bootstrap

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 90.8%
  • HTML 5.8%
  • CSS 3.4%
0