diff --git a/README.md b/README.md index 5d7cf78..e8a1871 100644 --- a/README.md +++ b/README.md @@ -1,29 +1,43 @@ -# AshAuthentication.Phoenix +![Logo](https://github.com/ash-project/ash/blob/main/logos/cropped-for-header-black-text.png?raw=true#gh-light-mode-only) +![Logo](https://github.com/ash-project/ash/blob/main/logos/cropped-for-header-white-text.png?raw=true#gh-dark-mode-only) -![Logo](https://github.com/ash-project/ash/blob/main/logos/ash-auth-logo.svg?raw=true) ![Elixir CI](https://github.com/team-alembic/ash_authentication_phoenix/workflows/Elixir%20Library/badge.svg) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Hex version badge](https://img.shields.io/hexpm/v/ash_authentication_phoenix.svg)](https://hex.pm/packages/ash_authentication_phoenix) +[![Hexdocs badge](https://img.shields.io/badge/docs-hexdocs-purple)](https://hexdocs.pm/ash_authentication_phoenix) -The `ash_authentication_phoenix` package extends -[`ash_authentication`](https://github.com/team-alembic/ash_authentication) by -adding router helpers, plugs and behaviours that makes adding authentication to -an existing Ash-based Phoenix application dead easy. +# Ash Authentication Phoenix -## Documentation +Welcome! Here you will find everything you need to know to get started with Ash Authentication and Phoenix. This documentation is best viewed on [hexdocs](https://hexdocs.pm/ash_authentication_phoenix) -See the [official documentation](https://ash-hq.org) for more. +## About the Documentation -Additionally, documentation for the latest release will be [available on -hexdocs](https://hexdocs.pm/ash_authentication_phoenix) and for the [`main` -branch](https://team-alembic.github.io/ash_authentication_phoenix). +[**Tutorials**](#tutorials) walk you through a series of steps to accomplish a goal. These are **learning-oriented**, and are a great place for beginners to start. -## Contributing +--- - * To contribute updates, fixes or new features please fork and open a pull-request against `main`. - * Please use [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) - this allows us to dynamically generate the changelog. - * Feel free to ask any questions on out [GitHub discussions page](https://github.com/team-alembic/ash_authentication_phoenix/discussions). +[**Topics**](#topics) provide a high level overview of a specific concept or feature. These are **understanding-oriented**, and are perfect for discovering design patterns, features, and tools related to a given topic. -## License +--- -MIT +[**How-to**](#how-to) guides are **goal-oriented** recipes for accomplishing specific tasks. These are also good to browse to get an idea of how Ash Authentication works and what is possible with it. + +--- + +[**Reference**](#reference) documentation is produced automatically from our source code. It comes in the form of module documentation and DSL documentation. This documentation is **information-oriented**. Use the sidebar and the search bar to find relevant reference information. + +## Tutorials + +- [Get Started](documentation/tutorials/get-started.md) +- [Using with LiveView](documentation/tutorials/liveview.md) + +## Related packages + +- [Ash Framework](https://hexdocs.pm/ash) +- [Ash Authentication](https://hexdocs.pm/ash_authentication) + +--- + +[![Alembic](logos/alembic.png)](https://alembic.com.au) + +Proudly written and maintained by the team at [Alembic](https://alembic.com.au) for the Ash community. diff --git a/documentation/tutorials/getting-started-with-ash-authentication-phoenix.md b/documentation/tutorials/get-started.md similarity index 99% rename from documentation/tutorials/getting-started-with-ash-authentication-phoenix.md rename to documentation/tutorials/get-started.md index f215944..6e41abe 100644 --- a/documentation/tutorials/getting-started-with-ash-authentication-phoenix.md +++ b/documentation/tutorials/get-started.md @@ -230,14 +230,11 @@ defmodule Example.Accounts.User do strategies do password :password do identity_field :email - sign_in_tokens_enabled? true end end tokens do - enabled? true token_resource Example.Accounts.Token - signing_secret Example.Accounts.Secrets end end @@ -455,8 +452,8 @@ defmodule ExampleWeb.AuthController do def failure(conn, _activity, _reason) do conn - |> put_status(401) - |> render("failure.html") + |> put_flash(:error, "Incorrect email or password") + |> redirect(to: ~p"/sign-in") end def sign_out(conn, _params) do diff --git a/documentation/tutorials/use-ash-authentication-with-liveview.md b/documentation/tutorials/liveview.md similarity index 100% rename from documentation/tutorials/use-ash-authentication-with-liveview.md rename to documentation/tutorials/liveview.md diff --git a/mix.exs b/mix.exs index 3fed3b7..afbdecd 100644 --- a/mix.exs +++ b/mix.exs @@ -25,8 +25,8 @@ defmodule AshAuthentication.Phoenix.MixProject do main: "readme", extras: [ "README.md", - "documentation/tutorials/getting-started-with-ash-authentication-phoenix.md", - "documentation/tutorials/use-ash-authentication-with-liveview.md" + "documentation/tutorials/get-started.md", + "documentation/tutorials/liveview.md" ], groups_for_extras: [ Tutorials: ~r'documentation/tutorials',