mirror of
https://github.com/team-alembic/ash_authentication_phoenix.git
synced 2024-09-20 13:34:26 +12:00
docs: Updates documentation to nest in the resources folder
This commit is contained in:
parent
a15b55d6f3
commit
0a990b9dc1
1 changed files with 15 additions and 13 deletions
|
@ -185,14 +185,15 @@ At the end we should have the following directory structure:
|
||||||
```bash
|
```bash
|
||||||
lib/example
|
lib/example
|
||||||
├── accounts
|
├── accounts
|
||||||
|
| ├── accounts.ex
|
||||||
|
| └── resources
|
||||||
│ ├── registry.ex
|
│ ├── registry.ex
|
||||||
│ ├── token.ex
|
│ ├── token.ex
|
||||||
│ └── user.ex
|
| └── user.ex
|
||||||
├── accounts.ex
|
|
||||||
...
|
...
|
||||||
```
|
```
|
||||||
|
|
||||||
**lib/example/accounts.ex**
|
**lib/example/accounts/accounts.ex**
|
||||||
|
|
||||||
```elixir
|
```elixir
|
||||||
defmodule Example.Accounts do
|
defmodule Example.Accounts do
|
||||||
|
@ -204,7 +205,7 @@ defmodule Example.Accounts do
|
||||||
end
|
end
|
||||||
```
|
```
|
||||||
|
|
||||||
**lib/example/accounts/user.ex**
|
**lib/example/accounts/resources/user.ex**
|
||||||
|
|
||||||
```elixir
|
```elixir
|
||||||
defmodule Example.Accounts.User do
|
defmodule Example.Accounts.User do
|
||||||
|
@ -241,12 +242,12 @@ defmodule Example.Accounts.User do
|
||||||
end
|
end
|
||||||
|
|
||||||
identities do
|
identities do
|
||||||
identity :unique_email, [:email]
|
identity :email, [:email]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
```
|
```
|
||||||
|
|
||||||
**lib/example/accounts/token.ex**
|
**lib/example/accounts/resources/token.ex**
|
||||||
|
|
||||||
```elixir
|
```elixir
|
||||||
defmodule Example.Accounts.Token do
|
defmodule Example.Accounts.Token do
|
||||||
|
@ -508,9 +509,9 @@ Visit [`localhost:4000/sign-out`](http://localhost:4000/sign-out) from your brow
|
||||||
|
|
||||||
## Reset Password
|
## Reset Password
|
||||||
|
|
||||||
In this section we add a reset password functionality. Which is triggered by adding `resettable` in the `User` resource. Please replace the `strategies` block in `lib/example/accounts/user.ex` with the following code:
|
In this section we add a reset password functionality. Which is triggered by adding `resettable` in the `User` resource. Please replace the `strategies` block in `lib/example/accounts/resources/user.ex` with the following code:
|
||||||
|
|
||||||
**lib/example/accounts/user.ex**
|
**lib/example/accounts/resources/user.ex**
|
||||||
|
|
||||||
```elixir
|
```elixir
|
||||||
# [...]
|
# [...]
|
||||||
|
@ -538,6 +539,7 @@ defmodule Example.Accounts.User.Senders.SendPasswordResetEmail do
|
||||||
use AshAuthentication.Sender
|
use AshAuthentication.Sender
|
||||||
use ExampleWeb, :verified_routes
|
use ExampleWeb, :verified_routes
|
||||||
|
|
||||||
|
@impl AshAuthentication.Sender
|
||||||
def send(user, token, _) do
|
def send(user, token, _) do
|
||||||
Example.Accounts.Emails.deliver_reset_password_instructions(
|
Example.Accounts.Emails.deliver_reset_password_instructions(
|
||||||
user,
|
user,
|
||||||
|
|
Loading…
Reference in a new issue