{"id":13562034,"url":"https://github.com/aaronrenner/phx_gen_auth","last_synced_at":"2025-04-03T18:32:07.893Z","repository":{"id":46097708,"uuid":"249814608","full_name":"aaronrenner/phx_gen_auth","owner":"aaronrenner","description":"An authentication system generator for Phoenix 1.5 applications.","archived":true,"fork":false,"pushed_at":"2021-08-21T07:10:31.000Z","size":510,"stargazers_count":772,"open_issues_count":0,"forks_count":55,"subscribers_count":41,"default_branch":"master","last_synced_at":"2024-11-04T14:42:28.451Z","etag":null,"topics":["authentication","phoenix"],"latest_commit_sha":null,"homepage":"","language":"Elixir","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/aaronrenner.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-24T20:48:16.000Z","updated_at":"2024-10-30T04:28:56.000Z","dependencies_parsed_at":"2022-09-26T18:20:55.987Z","dependency_job_id":null,"html_url":"https://github.com/aaronrenner/phx_gen_auth","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aaronrenner%2Fphx_gen_auth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aaronrenner%2Fphx_gen_auth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aaronrenner%2Fphx_gen_auth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aaronrenner%2Fphx_gen_auth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aaronrenner","download_url":"https://codeload.github.com/aaronrenner/phx_gen_auth/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247056764,"owners_count":20876454,"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":["authentication","phoenix"],"created_at":"2024-08-01T13:01:03.831Z","updated_at":"2025-04-03T18:32:07.288Z","avatar_url":"https://github.com/aaronrenner.png","language":"Elixir","funding_links":[],"categories":["Authentication","Projects","Uncategorized"],"sub_categories":["Uncategorized"],"readme":"# Phx.Gen.Auth\n\nAn authentication system generator for Phoenix 1.5 applications.\n\n**Note: This project is no longer maintained as `mix phx.gen.auth` has been merged into Phoenix v1.6.**\n\n## Overview\n\nThe purpose of `phx.gen.auth` is to generate a pre-built authentication system into\na Phoenix 1.5 application that follows both security and elixir best practices. By generating\ncode into the user's application instead of using a library, the user has complete freedom\nto modify the authentication system so it works best with their app. The following links\nhave more information regarding the motivation and design of the code this generates.\n\n* José Valim's blog post - [An upcoming authentication solution for Phoenix](https://dashbit.co/blog/a-new-authentication-solution-for-phoenix)\n* [Original pull request on bare phoenix app][auth pr]\n* [Original design spec](https://github.com/dashbitco/mix_phx_gen_auth_demo/blob/auth/README.md)\n\n\n## Usage\n\n### Generating a Phoenix 1.5 app\n\n`phx.gen.auth` must be installed into a Phoenix 1.5 application.\n\nOnce the installer is installed, a new project can be generated by running\n\n    $ mix phx.new my_app\n\nPlease note, the `--no-ecto` and `--no-html` options are not supported.\n\n### Installation\n\nAfter running `mix phx.new`, `cd` into your application's directory (ex. `my_app`).\n\n#### Basic installation\n\n1. Add `phx_gen_auth` to your list of dependencies in `mix.exs`\n\n    ```elixir\n    def deps do\n      [\n        {:phx_gen_auth, \"~\u003e 0.7\", only: [:dev], runtime: false},\n        ...\n      ]\n    end\n    ```\n1. Install and compile the dependencies\n\n    ```\n    $ mix do deps.get, deps.compile\n    ```\n\n#### Umbrella installation\n\n1. `cd` into your project's web app directory (ex. `apps/my_app_web`)\n\n    ```\n    $ cd apps/my_app_web\n    ```\n1. Add `phx_gen_auth` to your list of dependencies in `mix.exs`\n\n    ```elixir\n    def deps do\n      [\n        {:phx_gen_auth, \"~\u003e 0.7\", only: [:dev], runtime: false},\n        ...\n      ]\n    end\n    ```\n1. Install and compile the dependencies\n\n    ```\n    $ mix do deps.get, deps.compile\n    ```\n\n### Running the generator\n\nFrom the root of your phoenix app (or `apps/my_app_web` in an umbrella app), you\ncan install the authentication system with the following command\n\n    $ mix phx.gen.auth Accounts User users\n\nThis creates the templates,views, and controllers on the web namespace,\nand a new `MyApp.Accounts` [context][phoenix contexts guide], in the application\nnamespace.\n\nVerify the database connection details for the development and test environments in `config/`\nso the migrator and tests can run properly. Then run the following to create the database\n\n    $ mix ecto.create\n\nNext, let's install the dependencies and migrate the database\n\n    $ mix deps.get\n    $ mix ecto.migrate\n\nLet's run the tests and make sure our new authentication system works as\nexpected.\n\n    $ mix test\n\nFinally, let's start our phoenix server and try it out.\n\n    $ mix phx.server\n\n#### Note on apps upgraded from Phoenix 1.4\n\nIf you've upgraded your app from Phoenix 1.4, you'll need to make the following update to `test/support/conn_case.ex` to get `mix test` to pass:\n\n```diff\nusing do\n  quote do\n    # Import conveniences for testing with connections\n    import Plug.Conn\n    import Phoenix.ConnTest\n+   import DemoWeb.ConnCase\n    alias DemoWeb.Router.Helpers, as: Routes\n\n    # The default endpoint for testing\n    @endpoint DemoWeb.Endpoint\n  end\nend\n```\n\n### Changing id types\n\nBy default, this generator uses the same type of id fields as the rest of the\napplication. To override this configuration, the generator accepts `--binary-id`\nand `--no-binary-id` flags.\n\n    $ mix phx.gen.auth Accounts User users --binary-id\n\nMore information about these options are available in the\n[documentation](https://hexdocs.pm/phx_gen_auth/Mix.Tasks.Phx.Gen.Auth.html#module-binary-ids).\n\n### Learning more\n\nTo learn more about `phx.gen.auth`, run the following command.\n\n    $ mix help phx.gen.auth\n\nYou can also look up the mix task in [hexdocs](https://hexdocs.pm/phx_gen_auth).\n\n## Upgrading\n\nSince `mix phx.gen.auth` generates its code directly into your application, upgrading the version\nof this library will not upgrade your application's current authentication logic.\n\nTo see the changes that have been made to the generator output since the version that was used in\nyour application, visit the [CHANGELOG](CHANGELOG.md) and click the `[Diff]` links for each\nversion. These diffs will show you the changes to make to your application so it can be up to date\nwith the current generator output.\n\n## License\n\nCopyright 2020 Dashbit, Aaron Renner\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\n\n[phoenix contexts guide]: https://hexdocs.pm/phoenix/contexts.html\n[auth pr]: https://github.com/dashbitco/mix_phx_gen_auth_demo/pull/1\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faaronrenner%2Fphx_gen_auth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faaronrenner%2Fphx_gen_auth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faaronrenner%2Fphx_gen_auth/lists"}