{"id":13507435,"url":"https://github.com/madebymany/passwordless_auth","last_synced_at":"2025-07-30T09:34:04.017Z","repository":{"id":62430289,"uuid":"125247972","full_name":"madebymany/passwordless_auth","owner":"madebymany","description":"A library for simple passwordless authentication","archived":false,"fork":false,"pushed_at":"2020-08-18T07:05:47.000Z","size":44,"stargazers_count":50,"open_issues_count":1,"forks_count":6,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-07-13T20:04:08.847Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Elixir","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/madebymany.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-03-14T17:16:12.000Z","updated_at":"2025-03-29T05:11:15.000Z","dependencies_parsed_at":"2022-11-01T20:17:49.035Z","dependency_job_id":null,"html_url":"https://github.com/madebymany/passwordless_auth","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/madebymany/passwordless_auth","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madebymany%2Fpasswordless_auth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madebymany%2Fpasswordless_auth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madebymany%2Fpasswordless_auth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madebymany%2Fpasswordless_auth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/madebymany","download_url":"https://codeload.github.com/madebymany/passwordless_auth/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madebymany%2Fpasswordless_auth/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267846303,"owners_count":24153926,"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","status":"online","status_checked_at":"2025-07-30T02:00:09.044Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-08-01T02:00:33.489Z","updated_at":"2025-07-30T09:34:03.978Z","avatar_url":"https://github.com/madebymany.png","language":"Elixir","funding_links":[],"categories":["Authentication"],"sub_categories":[],"readme":"# PasswordlessAuth\n\nPasswordlessAuth provides functionality that can be used in an authentication\nor verification system, such as a passwordless or multi-factor authentication\nflow, or for verifying a user's ownership of a phone number, email address\nor any other identifying address.\n\n- Generate verification codes\n- Verify a user's attempt at entering a code\n- Rate limit attempts\n- Expire codes\n\nThis library doesn't deal with sending the codes to recipients. \n\nSee [Usage](#usage) for example usage.\n\n## Documentation\n\nDocumentation is available at [https://hexdocs.pm/passwordless_auth](https://hexdocs.pm/passwordless_auth)\n\n## Installation\n\nAdd `:passwordless_auth` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:passwordless_auth, \"~\u003e 0.3.0\"}\n  ]\nend\n```\n\n## Configuration\n\nThe following PasswordlessAuth config can be set in your `config/config.exs` file:\n\n```elixir\nconfig :passwordless_auth,\n  # How long codes are valid for\n  verification_code_ttl: 300, # seconds; default: 300\n  # Rate limiting: how many failed attempts are allowed before the timeout is applied\n  num_attempts_before_timeout: 5, # default: 5\n  # Rate limiting: how long to disallow attempts after the limit has been reached\n  rate_limit_timeout_length: 60, # seconds; default: 60\n  # How often to clear out expired codes\n  garbage_collector_frequency: 30 # seconds; default: 30\n```\n\n## Usage\n\nHere's an example where the code is sent to a recipient's phone number using ExTwilio.\n\n### 1. Generate a verification code for the recipient\n\nUser enters their phone number to request a verification code.\n\n```elixir\ncode = PasswordlessAuth.generate_code(\"+447123456789\")\n=\u003e \"123456\"\n```\n\n### 2. Send the code to the recipient\n\nThis library doesn't deal with SMS or emails, so this bit is up to you.\n```elixir\nExTwilio.Message.create(%{\n  to: \"+447123456789\",\n  body: \"Your code is #{code}\"\n})\n```\n\n### 3. Verify the code\n\nRecipient receives a text message with their verification code. They enter it into your system and you verify that it is correct.\n\n```elixir\nattempt_code = \"123456\" # The user's attempt at entering the correct verification code.\nPasswordlessAuth.verify_code(\n  \"+447123456789\",\n  attempt_code\n)\n```\n\nReturns `true` or `false`.\n\nOnce a code has been verified, you can remove it so that it can't be used again before it expires.\n\n```elixir\nPasswordlessAuth.remove_code(\"+447123456789\")\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmadebymany%2Fpasswordless_auth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmadebymany%2Fpasswordless_auth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmadebymany%2Fpasswordless_auth/lists"}