docs: improve getting started guides (#140)

This commit is contained in:
Darren Black 2023-01-17 15:05:19 +11:00 committed by GitHub
parent bc42cc7396
commit a5a1c2cdc3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 2 deletions

View file

@ -20,6 +20,17 @@ defp deps()
end end
``` ```
And add `ash_authentication` to your `.formatter.exs`:
```elixir
# .formatter.exs
[
# ...
import_deps: [:ash_authentication]
]
```
## Choosing your extensions, strategies and add-ons ## Choosing your extensions, strategies and add-ons
Ash Authentication supports many different features, each configured separately. Ash Authentication supports many different features, each configured separately.
@ -154,7 +165,7 @@ defmodule MyApp.Accounts.User do
attributes do attributes do
uuid_primary_key :id uuid_primary_key :id
attribute :email, :ci_string, allow_nil?: false attribute :email, :ci_string, allow_nil?: false
attribute :hashed_password, :string, allow_nil?: false attribute :hashed_password, :string, allow_nil?: false, sensitive?: true
end end
authentication do authentication do
@ -172,7 +183,7 @@ defmodule MyApp.Accounts.User do
signing_secret fn _, _ -> signing_secret fn _, _ ->
Application.fetch_env(:my_app, :token_signing_secret) Application.fetch_env(:my_app, :token_signing_secret)
end end
do end
end end
postgres do postgres do

View file

@ -28,6 +28,17 @@ end
Use `mix hex.info ash_authentication_phoenix` to quickly find the latest Use `mix hex.info ash_authentication_phoenix` to quickly find the latest
version. version.
Add `ash_authentication_phoenix` to your `.formatter.exs`:
```elixir
# .formatter.exs
[
# ...
import_deps: [:ash_authentication_phoenix]
]
```
## {{link:ash_authentication_phoenix:module:AshAuthentication.Phoenix.Router}} ## {{link:ash_authentication_phoenix:module:AshAuthentication.Phoenix.Router}}
`ash_authentication_phoenix` includes several helper macros which can generate `ash_authentication_phoenix` includes several helper macros which can generate