{"id":16096022,"url":"https://github.com/frenchbread/server.js-auth-example","last_synced_at":"2025-03-18T07:30:20.155Z","repository":{"id":153546623,"uuid":"109785653","full_name":"frenchbread/server.js-auth-example","owner":"frenchbread","description":"PassportJS + JWT + ServerJS","archived":false,"fork":false,"pushed_at":"2017-11-07T13:12:06.000Z","size":25,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-16T17:45:26.634Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/frenchbread.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}},"created_at":"2017-11-07T04:12:04.000Z","updated_at":"2019-04-06T14:12:06.000Z","dependencies_parsed_at":"2023-05-19T09:45:26.646Z","dependency_job_id":null,"html_url":"https://github.com/frenchbread/server.js-auth-example","commit_stats":{"total_commits":3,"total_committers":1,"mean_commits":3.0,"dds":0.0,"last_synced_commit":"851b3c8491b0230d5549ebcc75230f961b64a491"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frenchbread%2Fserver.js-auth-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frenchbread%2Fserver.js-auth-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frenchbread%2Fserver.js-auth-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frenchbread%2Fserver.js-auth-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/frenchbread","download_url":"https://codeload.github.com/frenchbread/server.js-auth-example/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244177648,"owners_count":20410993,"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":[],"created_at":"2024-10-09T17:10:11.058Z","updated_at":"2025-03-18T07:30:20.147Z","avatar_url":"https://github.com/frenchbread.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# server.js-auth-example\n\n\u003e [PassportJS](https://github.com/jaredhanson/passport) + [JWT](https://github.com/auth0/node-jsonwebtoken) + [ServerJs](https://github.com/franciscop/server)\n\n### Setup\n\n\u003e **NOTE:** requires MongoDB up and running\n\n```bash\n# Clone repo\n❯ git clone https://github.com/frenchbread/server.js-auth-example.git \u0026\u0026 cd server.js-auth-example\n\n# Install dependencies\n❯ yarn install\n# or\n❯ npm install\n\n# Start server\n❯ node server.js\n```\n\n### Usage\n\n#### Register new user\n\n##### `POST` - `/register`\n\n```bash\n❯ curl -H \"Content-Type: application/json\" -X POST -d '{\"email\":\"some@mail.com\",\"password\":\"somepassword\"}' http://localhost:3030/register\n\n# Server reply\n{\"ok\":true,\"message\":\"Successfully created new user.\"}\n```\n\n#### Login\n\n##### `POST` - `/login`\n\n```bash\n❯ curl -H \"Content-Type: application/json\" -X POST -d '{\"email\":\"some@mail.com\",\"password\":\"somepassword\"}' http://localhost:3030/login\n\n# Server reply\n{\"ok\":true,\"data\":{\"user\":{\"_id\":\"5a0129ec1cc973ec2e92b985\",\"email\":\"some@mail.com\"},\"token\":\"\u003creceived_jwt_token\u003e\"}}\n```\n\n#### Verify\n\n##### `GET` - `/verify`\n\n```bash\n❯ curl -H 'Authorization: JWT \u003creceived_jwt_token\u003e' -X GET http://127.0.0.1:3030/verify\n\n# Server reply\n{\"ok\":true,\"user\":{\"_id\":\"5a0129ec1cc973ec2e92b985\",\"email\":\"some@mail.com\",\"__v\":0}}\n```\n\n### License\n\n[MIT](https://github.com/frenchbread/server.js-auth-example/blob/master/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrenchbread%2Fserver.js-auth-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffrenchbread%2Fserver.js-auth-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrenchbread%2Fserver.js-auth-example/lists"}