{"id":19653806,"url":"https://github.com/nimjetushar/jwt-authentication-solution","last_synced_at":"2026-04-07T08:31:52.669Z","repository":{"id":48317816,"uuid":"148969019","full_name":"nimjetushar/jwt-authentication-solution","owner":"nimjetushar","description":"End to end solution for authentication using JWT","archived":false,"fork":false,"pushed_at":"2023-11-10T04:47:14.000Z","size":528,"stargazers_count":0,"open_issues_count":32,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-09T14:05:49.861Z","etag":null,"topics":["expressjs","jwt-authentication","jwt-tokens","nodejs","react-client","refresh-tokens"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nimjetushar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-09-16T06:15:45.000Z","updated_at":"2020-03-29T15:01:01.000Z","dependencies_parsed_at":"2025-06-09T14:05:12.740Z","dependency_job_id":"aaf34400-858e-43cd-a943-1267a9f2d2c7","html_url":"https://github.com/nimjetushar/jwt-authentication-solution","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nimjetushar/jwt-authentication-solution","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nimjetushar%2Fjwt-authentication-solution","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nimjetushar%2Fjwt-authentication-solution/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nimjetushar%2Fjwt-authentication-solution/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nimjetushar%2Fjwt-authentication-solution/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nimjetushar","download_url":"https://codeload.github.com/nimjetushar/jwt-authentication-solution/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nimjetushar%2Fjwt-authentication-solution/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31506562,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T03:10:19.677Z","status":"ssl_error","status_checked_at":"2026-04-07T03:10:13.982Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["expressjs","jwt-authentication","jwt-tokens","nodejs","react-client","refresh-tokens"],"created_at":"2024-11-11T15:15:21.311Z","updated_at":"2026-04-07T08:31:52.639Z","avatar_url":"https://github.com/nimjetushar.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jwt authentication solution\n\n[![Build Status](https://semaphoreci.com/api/v1/nimjetushar/jwt-authentication-solution/branches/master/shields_badge.svg)](https://semaphoreci.com/nimjetushar/jwt-authentication-solution)\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/37a5a6dcf7f84a6ba3a7b4c379b40b65)](https://www.codacy.com/app/tushar/jwt-authentication-solution?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=nimjetushar/jwt-authentication-solution\u0026amp;utm_campaign=Badge_Grade)\n[![Dependabot Status](https://api.dependabot.com/badges/status?host=github\u0026repo=nimjetushar/jwt-authentication-solution)](https://dependabot.com)\n\u003cbr/\u003e\n[![GitHub license](https://img.shields.io/github/license/nimjetushar/jwt-authentication-solution.svg)](https://github.com/nimjetushar/jwt-authentication-solution/blob/master/LICENSE)\n[![StackShare](https://img.shields.io/badge/tech-stack-0690fa.svg?style=flat)](https://stackshare.io/nimjetushar/jwt-authentication-solution)\n![GitHub pull requests](https://img.shields.io/github/issues-pr/nimjetushar/jwt-authentication-solution)\n\nProject provide the end to end solution for authentication. \nIt covers following points:-\n - User creation\n - Login\n - logout\n - Reset password / Forget password\n\n## Api\n\n### Create new user \n```\nRequest: POST\napi: /api/auth/create\nRequest: {  name: string;\n            email: string;\n            password: string;   }\nSuccess: Return user success message\n```\n### Login to create authorization token\n```\nRequest: POST\napi: /api/auth/login\nRequest: {  username: string;\n            password: string;   }\nSuccess: {  email: string;\n            name: string;\n            role: string;\n            token: string;\n            loginTime: number;  }\n```\n### Logout from that particular session\n```\nRequest: GET\napi: /api/auth/logout\n\nRequire \"authorization\" Header with recived token.\n```\n### Verify user before changing password and issue reset token to process for change password request\n```\nVerifies if user exists and sends reset token which can be used to reset password by password serivice\nRequest: POST\napi: /api/reset/verifyUser\nRequest: {  email: string; }\nSuccess: {  resetToken: string;\n            email: string;  }\n```\n### Upadate user password\n```\nTakes reset token which is send by verifyUser service \nRequest: POST\napi: /api/reset/password\nRequest: {  resetToken: string;\n            password: string;\n            confirmPassword: string;\n            email: string;  }\n```\n### Verify received authorization token\n```\nRequest: POST\napi: /api/auth/verify\n\nRequire \"authorization\" Header with recived token.\n```\n### Client UI\n```\nRequest: GET\napi: /\n\nReturn client application which can be used to login / create user / change password.\n```\n\n\n### Options\nApplication configurations can be updated using config.js\n\n1: Port\nDefault port is 8080 but can be updated as required.\n\n2: db_url\nDB url where authorization collection is present.\n\n3: auth_token_timeout\nDuration for which auth token send to client side will be valid.\nDefault is 1 day.\n\n4: refresh_token_timeout\nDuration for which refresh token will be valid which stats a logined user will be valid into application.\nDefault is 2 days.\n\n5: reset_token_timeout\nDuration for which password reset token is valid.\nDefault 5 min.\n\nThe implementaion is based on JWT tokken having concept of refresh tokken and auth tokken to keep user authenticated and reset token in case of password reset.\n\nServer implementation can be verified using Client application which is present in `/client`.\n\n## Usefull commands\n\nStart client locally\n```npm run client```\n\nStart server locally\n```npm run server```\n\nBuild client and server\n```npm run build```\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnimjetushar%2Fjwt-authentication-solution","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnimjetushar%2Fjwt-authentication-solution","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnimjetushar%2Fjwt-authentication-solution/lists"}