{"id":17899580,"url":"https://github.com/hasinthak/nodejs-jwt-api","last_synced_at":"2026-05-06T20:33:23.758Z","repository":{"id":136829576,"uuid":"231078422","full_name":"hasinthaK/nodeJs-JWT-API","owner":"hasinthaK","description":"NodeJs API for JWT authentication and Authorization. No Static assets are served. Only the API s are exposed via the URL.","archived":false,"fork":false,"pushed_at":"2020-12-09T03:13:39.000Z","size":93,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-03T05:27:04.093Z","etag":null,"topics":["jwt","nodejs","redis"],"latest_commit_sha":null,"homepage":"https://nodejwtapi.herokuapp.com","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/hasinthaK.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-12-31T11:31:55.000Z","updated_at":"2022-02-25T15:47:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"6ab47632-1602-4dd9-9bf2-0a72608ebf98","html_url":"https://github.com/hasinthaK/nodeJs-JWT-API","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hasinthaK/nodeJs-JWT-API","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hasinthaK%2FnodeJs-JWT-API","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hasinthaK%2FnodeJs-JWT-API/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hasinthaK%2FnodeJs-JWT-API/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hasinthaK%2FnodeJs-JWT-API/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hasinthaK","download_url":"https://codeload.github.com/hasinthaK/nodeJs-JWT-API/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hasinthaK%2FnodeJs-JWT-API/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32711183,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-06T19:35:05.142Z","status":"ssl_error","status_checked_at":"2026-05-06T19:35:03.996Z","response_time":117,"last_error":"SSL_read: 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":["jwt","nodejs","redis"],"created_at":"2024-10-28T16:00:06.496Z","updated_at":"2026-05-06T20:33:23.739Z","avatar_url":"https://github.com/hasinthaK.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NodeJs JWT Authentication API\n\n\n### Environment vars to be updated\nUpdate these env variables in `.env` file or platform specific environment\n\u003cpre\u003e * - required env vars(if not set, will fallback to predefined defaults) \u003c/pre\u003e\n```\nDB_CONN - remote db connection uri\nJWT_SECRET* - secret for jwt\nJWT_REFRESH_SECRET* - secret for refresh token\nJWT_EXP - expiration time for jwt(s)\nJWT_SECRET_EXP - expiration time for refresh token(s)\nREDIS_HOST - redis db host uri\nREDIS_PORT - redis db port\nREDIS_PASS - redis db password\nREDIS_EXP - Expiration for a Redis key\nPORT - server port/default 3000\n```\n\u003cp\u003e\nRedis \u0026 MongoDB should be installed either locally if remote connections are not provided \u0026 running in default configs.\n\n```\nFallback defaults\nMongoDB =\u003e db name - 'local', port - 27017\nRedis =\u003e host - localhost, port - 6379\n```\n\u003c/p\u003e\n\n---\n\n## Available endpoints\n- ### Register - Validates \u0026 create new user\n```json\nPOST\n/user/register\n{\n    \"name\":\"\",\n    \"email\":\"\",\n    \"password\":\"\"\n}\n\nresponse body - { user_id: created user's ID in DB }\n```\n\n- ### Login - returns a JWT\n```json\nPOST\n/user/login\n{\n    \"email\":\"\",\n    \"password\":\"\"\n}\n\nresponse body - { token: JWT, refreshtoken: refresh JWT } \n```\n\n- ### Private routes - Can be accessed only via presenting valid token inside 'auth-token' custom header\n```\ntest private Route:\n/get\n\nrequest header: 'auth-token: a valid JWT'\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhasinthak%2Fnodejs-jwt-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhasinthak%2Fnodejs-jwt-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhasinthak%2Fnodejs-jwt-api/lists"}