{"id":26179493,"url":"https://github.com/bezkoder/react-redux-jwt-auth","last_synced_at":"2025-10-03T21:52:55.019Z","repository":{"id":45658762,"uuid":"291892373","full_name":"bezkoder/react-redux-jwt-auth","owner":"bezkoder","description":"React Redux: Token Authentication example with JWT, React Router, Axios, Thunk Middleware","archived":false,"fork":false,"pushed_at":"2023-01-19T10:39:21.000Z","size":390,"stargazers_count":133,"open_issues_count":1,"forks_count":65,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-28T10:47:34.729Z","etag":null,"topics":["authentication","authorization","axios","jwt-authentication","react","react-jwt","react-redux","reactjs","redux"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bezkoder.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-09-01T04:06:36.000Z","updated_at":"2025-01-08T09:31:35.000Z","dependencies_parsed_at":"2023-02-10T22:45:29.444Z","dependency_job_id":null,"html_url":"https://github.com/bezkoder/react-redux-jwt-auth","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bezkoder%2Freact-redux-jwt-auth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bezkoder%2Freact-redux-jwt-auth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bezkoder%2Freact-redux-jwt-auth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bezkoder%2Freact-redux-jwt-auth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bezkoder","download_url":"https://codeload.github.com/bezkoder/react-redux-jwt-auth/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248972186,"owners_count":21191737,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["authentication","authorization","axios","jwt-authentication","react","react-jwt","react-redux","reactjs","redux"],"created_at":"2025-03-11T21:50:08.827Z","updated_at":"2025-10-03T21:52:49.965Z","avatar_url":"https://github.com/bezkoder.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## React Redux JWT Authentication \u0026 Authorization example\n\nBuild a React Redux Token Authentication example with JWT, LocalStorage, React Router, Axios and Bootstrap:\n- JWT Authentication Flow for User Signup \u0026 User Login\n- Project Structure for React Redux JWT Authentication, LocalStorage, Router, Axios\n- Working with Redux Actions, Reducers, Store for Application state\n- Creating React Components with Form Validation\n- React Components for accessing protected Resources (Authorization)\n- Dynamic Navigation Bar in React App\n\n## User Registration and User Login Flow\nFor JWT Authentication, we’re gonna call 2 endpoints:\n\n- POST `api/auth/signup` for User Registration\n- POST `api/auth/signin` for User Login\n\nThe 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.\n\n![react-jwt-authentication-flow](react-jwt-authentication-flow.png)\n\nFor more detail, please visit:\n\u003e [React Redux JWT Authentication \u0026 Authorization example](https://bezkoder.com/react-redux-jwt-auth/)\n\n\u003e [React - How to Logout when Token is expired](https://www.bezkoder.com/react-logout-token-expired/)\n\n\u003e [React Hooks + Redux: JWT Authentication \u0026 Authorization example](https://bezkoder.com/react-hooks-redux-login-registration-example/)\n\n\u003e [React JWT Authentication \u0026 Authorization (without Redux) example](https://bezkoder.com/react-jwt-auth/)\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n### Set port\n.env\n```\nPORT=8081\n```\n\n## Note:\nOpen `src/services/auth-header.js` and modify `return` statement for appropriate back-end (found in the tutorial).\n\n```js\nexport default function authHeader() {\n  const user = JSON.parse(localStorage.getItem('user'));\n\n  if (user \u0026\u0026 user.accessToken) {\n    // return { Authorization: 'Bearer ' + user.accessToken }; // for Spring Boot back-end\n    return { 'x-access-token': user.accessToken };             // for Node.js Express back-end\n  } else {\n    return {};\n  }\n}\n```\n\n## Project setup\n\nIn the project directory, you can run:\n\n```\nnpm install\n# or\nyarn install\n```\n\nor\n\n### Compiles and hot-reloads for development\n\n```\nnpm start\n# or\nyarn start\n```\n\nOpen [http://localhost:8081](http://localhost:8081) to view it in the browser.\n\nThe page will reload if you make edits.\n\n## Related Posts\n\u003e [In-depth Introduction to JWT-JSON Web Token](https://bezkoder.com/jwt-json-web-token/)\n\n\u003e [React.js CRUD example to consume Web API](https://bezkoder.com/react-crud-web-api/)\n\n\u003e [React Redux CRUD App example with Rest API](https://bezkoder.com/react-redux-crud-example/)\n\n\u003e [React Pagination example](https://bezkoder.com/react-pagination-material-ui/)\n\n\u003e [React File Upload with Axios and Progress Bar to Rest API](https://bezkoder.com/react-file-upload-axios/)\n\nFullstack (JWT Authentication \u0026 Authorization example):\n\u003e [React + Spring Boot](https://bezkoder.com/spring-boot-react-jwt-auth/)\n\n\u003e [React + Node.js Express](https://bezkoder.com/react-express-authentication-jwt/)\n\nFullstack CRUD with Node.js Express:\n\u003e [React.js + Node.js Express + MySQL](https://bezkoder.com/react-node-express-mysql/)\n\n\u003e [React.js + Node.js Express + PostgreSQL](https://bezkoder.com/react-node-express-postgresql/)\n\n\u003e [React.js + Node.js Express + MongoDB](https://bezkoder.com/react-node-express-mongodb-mern-stack/)\n\nFullstack CRUD with Spring Boot:\n\u003e [React.js + Spring Boot + MySQL](https://bezkoder.com/react-spring-boot-crud/)\n\n\u003e [React.js + Spring Boot + PostgreSQL](https://bezkoder.com/spring-boot-react-postgresql/)\n\n\u003e [React.js + Spring Boot + MongoDB](https://bezkoder.com/react-spring-boot-mongodb/)\n\nFullstack CRUD with Django:\n\u003e [React.js + Django Rest Framework](https://bezkoder.com/django-react-axios-rest-framework/)\n\nIntegration (run back-end \u0026 front-end on same server/port)\n\u003e [How to integrate React.js with Spring Boot](https://bezkoder.com/integrate-reactjs-spring-boot/)\n\n\u003e [Integrate React with Node.js Express on same Server/Port](https://bezkoder.com/integrate-react-express-same-server-port/)\n\nServerless:\n\u003e [React Firebase CRUD App with Realtime Database](https://bezkoder.com/react-firebase-crud/)\n\n\u003e [React Firestore CRUD App example | Firebase Cloud Firestore](https://bezkoder.com/react-firestore-crud/)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbezkoder%2Freact-redux-jwt-auth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbezkoder%2Freact-redux-jwt-auth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbezkoder%2Freact-redux-jwt-auth/lists"}