Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
R

react-hooks-jwt-auth

> 前端框架
Open source

React Hooks JWT Auth using React Router, Axios, Bootstrap: Token based Authentication & Authorization

198 stars0 likes2 views
WebsiteGitHub

About

React Hooks JWT Auth using React Router, Axios, Bootstrap: Token based Authentication & Authorization

React Hooks: JWT Authentication (without Redux) example

For more detail, please visit:

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

React Redux Login, Logout, Registration example with Hooks

React (Components) JWT Authentication & Authorization example

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).

javascript
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:

bash
npm install
# or
yarn install

or

Compiles and hot-reloads for development

bash
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

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

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

JavaScriptauthenticationauthorizationbootstraphooks-api-react

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category前端框架
PricingOpen source

> Related tools

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架