{"id":28120548,"url":"https://github.com/jquagliatini/now-connect","last_synced_at":"2026-05-02T20:41:34.891Z","repository":{"id":91443005,"uuid":"161082238","full_name":"jquagliatini/now-connect","owner":"jquagliatini","description":"A project replicating the now.sh login system","archived":false,"fork":false,"pushed_at":"2018-12-09T21:21:09.000Z","size":61,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-20T13:16:42.924Z","etag":null,"topics":["authentication","event-emitter","express","mailing","nodejs","nodemailer","now","server-sent-events"],"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/jquagliatini.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,"zenodo":null}},"created_at":"2018-12-09T21:16:58.000Z","updated_at":"2018-12-09T21:27:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"05d4d30c-a85d-49b3-a1fa-a9b39ee8c1e2","html_url":"https://github.com/jquagliatini/now-connect","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jquagliatini/now-connect","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jquagliatini%2Fnow-connect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jquagliatini%2Fnow-connect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jquagliatini%2Fnow-connect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jquagliatini%2Fnow-connect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jquagliatini","download_url":"https://codeload.github.com/jquagliatini/now-connect/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jquagliatini%2Fnow-connect/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32549387,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-02T19:18:06.202Z","status":"ssl_error","status_checked_at":"2026-05-02T19:16:21.335Z","response_time":132,"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":["authentication","event-emitter","express","mailing","nodejs","nodemailer","now","server-sent-events"],"created_at":"2025-05-14T07:41:15.690Z","updated_at":"2026-05-02T20:41:29.875Z","avatar_url":"https://github.com/jquagliatini.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# now.sh login system\n\nI was amazed by how ingenious the [now.sh](https://now.sh) login system is.\nI always wanted to reproduce it, so here is the base project.\n\nBasically, it's playing a lot with Server Sent Events and the EventEmitter API from node.\n\n## Installation\n\nJust run a\n\n    $ npm i -g maildev\n    $ npm i\n    $ maildev # You could do a `npx maildev` too!\n    $ npm start # in another terminal\n\nThen open maildev in a browser at http://localhost:1080. Just after that, open another tab at\nhttp://localhost:3000.\n\nFill in any valid email address, and check the inbox in maildev. Click the button, you should see\na message \"login success\" on the first form. That's it!\n\n## Roadmap\n\n- [x] basic auth scenario\n- [ ] adding a setTimeout\n- [ ] adding a real data store (redis)\n- [ ] security (see below)\n- [ ] JWT to keep the authentication state.\n\n## Security Considerations\n\nAt the moment, the implementation is naive at best.\nOne could really simply DOS the system, by simply sending a batch of request to the `/signin`\nendpoint. Preventing this could be done by throttling the requests, logging the ip address, and\na load of things I still need to investigate.\n\n## Endpoints\n\n### /\n\nThe main endpoint, serving a authentication form with only a email field.\n\n### POST /signin\n\nThe email handling operation. Will start the email sending operation, and serve another html\npage subsribing to a SSE page.\n\n### /sessions\n\nIf you want to check at any moment the current state of the app. It's a page subscribing to the\n'login' event displaying all the past and present sessions. By doing so, it automatically\nupdates as soon as someone logs in.\n\n### /connect/{sessionName}/{token}?email={email}\n\nFires the connection event and validates the user's email.\n\n### /stream/sessions\n\nA SSE endpoint to subscribe to any new login requests.\n\n### /session/{sessionName}\n\nSSE endpoint to subscribe to the 'clicked on login button in email' event.\nSessions names are a well known duo of adjective + animal name.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjquagliatini%2Fnow-connect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjquagliatini%2Fnow-connect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjquagliatini%2Fnow-connect/lists"}