{"id":25491811,"url":"https://github.com/matthewbub/auth-api","last_synced_at":"2026-02-09T05:38:04.190Z","repository":{"id":278139428,"uuid":"931549085","full_name":"matthewbub/auth-api","owner":"matthewbub","description":"jwt auth system ","archived":false,"fork":false,"pushed_at":"2025-02-12T13:35:48.000Z","size":26727,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-22T19:59:59.117Z","etag":null,"topics":["cloudflare","cloudflare-d1","honojs","openapi-standard"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/matthewbub.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":"2025-02-12T13:18:40.000Z","updated_at":"2025-05-24T06:11:53.000Z","dependencies_parsed_at":"2025-02-18T08:16:07.100Z","dependency_job_id":"2a0819a5-6109-4d72-9f23-96c99f041480","html_url":"https://github.com/matthewbub/auth-api","commit_stats":null,"previous_names":["matthewbub/auth-api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/matthewbub/auth-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthewbub%2Fauth-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthewbub%2Fauth-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthewbub%2Fauth-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthewbub%2Fauth-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matthewbub","download_url":"https://codeload.github.com/matthewbub/auth-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthewbub%2Fauth-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29257739,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-09T04:11:57.159Z","status":"ssl_error","status_checked_at":"2026-02-09T04:11:56.117Z","response_time":56,"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":["cloudflare","cloudflare-d1","honojs","openapi-standard"],"created_at":"2025-02-18T22:18:59.582Z","updated_at":"2026-02-09T05:38:04.153Z","avatar_url":"https://github.com/matthewbub.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Auth system\n\nSetup\n\nrename the .example.dev.vars to .dev.vars and add a uuid to the AUTH_KEY field\n\n```shell\n# auth with cloudflare\nnpx wrangler login\n# opens browser window...\n\n# confrim identity\nnpx wrangler whoami\n\n# setup db\nnpx wrangler d1 create auth_storage --location wnam\n# https://developers.cloudflare.com/workers/wrangler/commands/#d1-create\n\n# run migrations (local)\nnpx wrangler d1 migrations apply auth_storage --local\n\n# duplicate example.dev.vars \u003e .dev.vars\n# udpate with your secret values\n# ...\n\n# run dev server\nnpm run dev # wrangler dev\n\n# deploy to cloudflare workers\nnpm run deploy # wrangler deploy\n\n# run migrations in cloudflare\nnpx wrangler d1 migrations apply auth_storage --remote\n\n# set remote env\nnpx wrangler secret put AUTH_KEY\nnpx wrangler secret put RESEND_KEY\nnpx wrangler secret put NO_REPLY_EMAIL\nnpx wrangler secret put NO_REPLY_NAME\nnpx wrangler secret put NO_REPLY_PASSWORD\n\n# confirm\nnpx wrangler secret list\n\n# drop local db\nnpx wrangler d1 execute auth_storage --local --command=\"DELETE FROM password_history; DELETE FROM verification_tokens; DELETE FROM refresh_tokens; DELETE FROM users;\"\n\n# view schema\nnpx wrangler d1 execute auth_storage --local --command=\"\nSELECT sql FROM sqlite_master\nWHERE type IN ('table', 'index')\nAND name NOT LIKE 'sqlite_%'\nORDER BY type DESC, name;\"\n```\n\nWe're using Hono as an HTTP framework, and hosting on Cloudflare workers. First time here? Watch this vid: https://www.youtube.com/watch?v=H7Qe96fqg1M to get up to speed on Cloudflare Workers and Hono.\n\n## Routes\n\nHere's a map of all the routes in this service. Click an endpoint ot quickly jump to the definition\n\n| Route Type       | Method | Endpoint                       | Description                              |\n| ---------------- | ------ | ------------------------------ | ---------------------------------------- |\n| Public Routes    | POST   | /v3/public/sign-up             | new user registration returns JWT        |\n|                  | POST   | /v3/public/login               | user login, returns JWT                  |\n|                  | POST   | /v3/public/refresh-token       | refresh access token using refresh token |\n|                  | POST   | /v3/public/forgot-password     | initiate password reset                  |\n|                  | POST   | /v3/public/reset-password      | complete password reset with token       |\n|                  | GET    | /v3/public/verify-email/:token | verify email with token                  |\n|                  | POST   | /v3/public/resend-verification | resend verification email                |\n| Protected Routes | POST   | /v3/auth/logout                | invalidate current token                 |\n|                  | PUT    | /v3/auth/change-password       | change password while logged in          |\n|                  | GET    | /v3/auth/me                    | get current user info                    |\n|                  | PUT    | /v3/auth/me                    | update user info                         |\n|                  | DELETE | /v3/auth/me                    | delete account                           |\n| Admin Routes     | GET    | /v3/admin/users                | list all users                           |\n|                  | GET    | /v3/admin/users/:id            | get specific user                        |\n|                  | PUT    | /v3/admin/users/:id/status     | modify user status (suspend/activate)    |\n|                  | DELETE | /v3/admin/users/:id            | delete user account                      |\n\n## Adding a new app\n\n- Run the ./scripts/create-app-local.sh script\n- Run the ./scripts/create-app-remote.sh script\n- Configure the origin to your production domain; when you deploy to prod\n\n## Refactor to:\n\n```\nlib/bus/auth_v3/src/\n├── index.ts                # Main API setup\n├── routes/                 # Route definitions\n│   ├── index.ts\n│   ├── auth.ts\n│   └── public.ts\n├── definitions/           # OpenAPI definitions\n│   ├── index.ts\n│   ├── RouteDefinitionFactory.ts\n│   └── schemas/\n│       ├── index.ts\n│       └── SchemaBuilder.ts\n├── controllers/           # Request handlers\n│   ├── index.ts\n│   ├── auth.ts\n│   └── public.ts\n├── services/             # Business logic\n│   ├── index.ts\n│   └── auth.ts\n└── middleware/           # Custom middleware\n│   ├── index.ts\n│   ├── auth.ts\n│   └── appId.ts\n└── types                 # Type definitions\n    └── index.ts\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatthewbub%2Fauth-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatthewbub%2Fauth-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatthewbub%2Fauth-api/lists"}