GithubHelp home page GithubHelp logo

igor981 / react-redux-login-example Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bezkoder/react-redux-login-example

0.0 0.0 0.0 291 KB

React Redux Login example (Register, Logout) using Redux Toolkit, React Router, Axios, Bootstrap, Hooks

Shell 0.03% HTML 5.90% CSS 3.41% JavaScript 90.66%

react-redux-login-example's Introduction

React Redux Login example using Redux-toolkit & Hooks

  • JWT Authentication Flow for User Login, Register, Logout
  • Project Structure for React Redux JWT Authentication, Router, Axios
  • Working with Redux Actions, Reducers, Store using redux-toolkit
  • Creating React Function Components with Hooks & Form Validation
  • React Function Components for accessing protected Resources (Authorization)
  • Dynamic Navigation Bar in React App

For more detail, please visit:

React Redux Login & Registration example with Redux-toolkit & Hooks

Signup Page:

react-redux-login-register-example-redux-toolkit-signup

Login Page:

react-redux-login-register-example-redux-toolkit-login

For Authorized account login (Moderator for example), the navigation bar will change:

react-redux-login-register-example-redux-toolkit-authorization

Related Posts (without redux-toolkit):

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)

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.

Related Posts

In-depth Introduction to JWT-JSON Web Token

React CRUD example using Hooks

React Pagination using Hooks example

React Hooks File Upload example

React Form Validation with Hooks example

Fullstack with Node.js Express:

React.js + Node.js Express + MySQL

React.js + Node.js Express + PostgreSQL

React.js + Node.js Express + MongoDB

Fullstack with Spring Boot:

React.js + Spring Boot + MySQL

React.js + Spring Boot + PostgreSQL

React.js + Spring Boot + MongoDB

Fullstack with Django:

React.js Hooks + Django Rest Framework

Serverless:

React Hooks Firebase Realtime Database: CRUD App

React Hooks Firestore example: CRUD App

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

Integrate React with Spring Boot

Integrate React with Node.js Express

react-redux-login-example's People

Contributors

tienbku avatar

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.