mirror of
https://github.com/team-alembic/ash_authentication_phoenix.git
synced 2024-09-20 05:23:55 +12:00
docs: change tutorial to help enable policy authorizers (#446)
* docs: add snippet to help enable policy authorizers * docs: add info about `picosat_elixir` to 'Get Started' section * docs: change wording to discourage use of `simple_sat` unless needed
This commit is contained in:
parent
8583623551
commit
c7ecd7214a
1 changed files with 10 additions and 1 deletions
|
@ -33,7 +33,8 @@ defmodule Example.MixProject do
|
||||||
{:ash, "~> x.x"},
|
{:ash, "~> x.x"},
|
||||||
{:ash_authentication, "~> x.x"},
|
{:ash_authentication, "~> x.x"},
|
||||||
{:ash_authentication_phoenix, "~> x.x"},
|
{:ash_authentication_phoenix, "~> x.x"},
|
||||||
{:ash_postgres, "~> x.x"}
|
{:ash_postgres, "~> x.x"},
|
||||||
|
{:picosat_elixir, "~> x.x"}
|
||||||
# <-- add these lines
|
# <-- add these lines
|
||||||
]
|
]
|
||||||
end
|
end
|
||||||
|
@ -46,6 +47,10 @@ Let's fetch everything:
|
||||||
$ mix deps.get
|
$ mix deps.get
|
||||||
```
|
```
|
||||||
|
|
||||||
|
> ### Picosat installation issues? {: .info}
|
||||||
|
>
|
||||||
|
> If you have trouble compiling `picosat_elixir`, then replace `{:picosat_elixir, "~> x.x"}` with `{:simple_sat, "~> x.x"}` to use a simpler (but mildly slower) solver. You can always switch back to `picosat_elixir` later once you're done with the tutorial.
|
||||||
|
|
||||||
### Formatter
|
### Formatter
|
||||||
|
|
||||||
We can make our life easier and the code more consistent by adding formatters to the project. We will use [Elixir's built-in formatter](https://hexdocs.pm/mix/master/Mix.Tasks.Format.html) for this.
|
We can make our life easier and the code more consistent by adding formatters to the project. We will use [Elixir's built-in formatter](https://hexdocs.pm/mix/master/Mix.Tasks.Format.html) for this.
|
||||||
|
@ -212,6 +217,8 @@ defmodule Example.Accounts.User do
|
||||||
use Ash.Resource,
|
use Ash.Resource,
|
||||||
domain: Example.Accounts,
|
domain: Example.Accounts,
|
||||||
data_layer: AshPostgres.DataLayer,
|
data_layer: AshPostgres.DataLayer,
|
||||||
|
# If using policies, enable the policy authorizer:
|
||||||
|
# authorizers: [Ash.Policy.Authorizer],
|
||||||
extensions: [AshAuthentication]
|
extensions: [AshAuthentication]
|
||||||
|
|
||||||
attributes do
|
attributes do
|
||||||
|
@ -281,6 +288,8 @@ defmodule Example.Accounts.Token do
|
||||||
use Ash.Resource,
|
use Ash.Resource,
|
||||||
domain: Example.Accounts,
|
domain: Example.Accounts,
|
||||||
data_layer: AshPostgres.DataLayer,
|
data_layer: AshPostgres.DataLayer,
|
||||||
|
# If using policies, enable the policy authorizer:
|
||||||
|
# authorizers: [Ash.Policy.Authorizer],
|
||||||
extensions: [AshAuthentication.TokenResource]
|
extensions: [AshAuthentication.TokenResource]
|
||||||
|
|
||||||
postgres do
|
postgres do
|
||||||
|
|
Loading…
Reference in a new issue