diff --git a/config/dev.exs b/config/dev.exs index 0e08475..e555bd0 100644 --- a/config/dev.exs +++ b/config/dev.exs @@ -24,11 +24,6 @@ config :ash_authentication, Example.Repo, show_sensitive_data_on_connection_error: true, pool_size: 10 -config :ash_authentication, Example, - resources: [ - registry: Example.Registry - ] - config :ash_authentication, authentication: [ strategies: [ diff --git a/config/test.exs b/config/test.exs index 22ea509..81daf30 100644 --- a/config/test.exs +++ b/config/test.exs @@ -10,11 +10,6 @@ config :ash_authentication, Example.Repo, pool: Ecto.Adapters.SQL.Sandbox, pool_size: 10 -config :ash_authentication, Example, - resources: [ - registry: Example.Registry - ] - config :bcrypt_elixir, :log_rounds, 4 config :ash, :disable_async?, true diff --git a/dev/dev_server/json_api_router.ex b/dev/dev_server/json_api_router.ex index 287aafa..6ab03b9 100644 --- a/dev/dev_server/json_api_router.ex +++ b/dev/dev_server/json_api_router.ex @@ -1,4 +1,4 @@ defmodule DevServer.JsonApiRouter do @moduledoc false - use AshJsonApi.Api.Router, api: Example, registry: Example.Registry + use AshJsonApi.Api.Router, api: Example end diff --git a/documentation/tutorials/getting-started-with-authentication.md b/documentation/tutorials/getting-started-with-authentication.md index de41f39..ac1d9d8 100644 --- a/documentation/tutorials/getting-started-with-authentication.md +++ b/documentation/tutorials/getting-started-with-authentication.md @@ -101,7 +101,8 @@ defmodule MyApp.Accounts do use Ash.Api resources do - registry MyApp.Accounts.Registry + resource MyApp.Accounts.User + resource MyApp.Accounts.Token end end ``` @@ -113,21 +114,6 @@ Be sure to add it to the `ash_apis` config in your `config.exs` config :my_app, :ash_apis, [..., MyApp.Accounts] ``` -Next, let's define our registry: - -```elixir -# lib/my_app/accounts/registry.ex - -defmodule MyApp.Accounts.Registry do - use Ash.Registry, extensions: [Ash.Registry.ResourceValidations] - - entries do - entry MyApp.Accounts.User - entry MyApp.Accounts.Token - end -end -``` - Next, let's define our `Token` resource. This resource is needed if token generation is enabled for any resources in your application. Most of the contents are auto-generated, so we just need to provide the data layer @@ -152,7 +138,7 @@ defmodule MyApp.Accounts.Token do table "tokens" repo MyApp.Repo end - + # If using policies, add the following bypass: # policies do # bypass AshAuthentication.Checks.AshAuthenticationInteraction do @@ -205,7 +191,7 @@ defmodule MyApp.Accounts.User do identities do identity :unique_email, [:email] end - + # If using policies, add the folowing bypass: # policies do # bypass AshAuthentication.Checks.AshAuthenticationInteraction do diff --git a/test/support/example.ex b/test/support/example.ex index 712e7f0..5c61bdb 100644 --- a/test/support/example.ex +++ b/test/support/example.ex @@ -3,7 +3,10 @@ defmodule Example do use Ash.Api, otp_app: :ash_authentication, extensions: [AshGraphql.Api, AshJsonApi.Api] resources do - registry Example.Registry + resource Example.User + resource Example.UserWithTokenRequired + resource Example.Token + resource Example.UserIdentity end json_api do diff --git a/test/support/example/registry.ex b/test/support/example/registry.ex deleted file mode 100644 index 0cd130d..0000000 --- a/test/support/example/registry.ex +++ /dev/null @@ -1,11 +0,0 @@ -defmodule Example.Registry do - @moduledoc false - use Ash.Registry, extensions: [Ash.Registry.ResourceValidations] - - entries do - entry Example.User - entry Example.UserWithTokenRequired - entry Example.Token - entry Example.UserIdentity - end -end