mirror of
https://github.com/team-alembic/ash_authentication_phoenix.git
synced 2024-09-20 05:23:55 +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
|
||||
lib/example
|
||||
├── accounts
|
||||
| ├── accounts.ex
|
||||
| └── resources
|
||||
│ ├── registry.ex
|
||||
│ ├── token.ex
|
||||
│ └── user.ex
|
||||
├── accounts.ex
|
||||
| └── user.ex
|
||||
...
|
||||
```
|
||||
|
||||
**lib/example/accounts.ex**
|
||||
**lib/example/accounts/accounts.ex**
|
||||
|
||||
```elixir
|
||||
defmodule Example.Accounts do
|
||||
|
@ -204,7 +205,7 @@ defmodule Example.Accounts do
|
|||
end
|
||||
```
|
||||
|
||||
**lib/example/accounts/user.ex**
|
||||
**lib/example/accounts/resources/user.ex**
|
||||
|
||||
```elixir
|
||||
defmodule Example.Accounts.User do
|
||||
|
@ -241,12 +242,12 @@ defmodule Example.Accounts.User do
|
|||
end
|
||||
|
||||
identities do
|
||||
identity :unique_email, [:email]
|
||||
identity :email, [:email]
|
||||
end
|
||||
end
|
||||
```
|
||||
|
||||
**lib/example/accounts/token.ex**
|
||||
**lib/example/accounts/resources/token.ex**
|
||||
|
||||
```elixir
|
||||
defmodule Example.Accounts.Token do
|
||||
|
@ -508,9 +509,9 @@ Visit [`localhost:4000/sign-out`](http://localhost:4000/sign-out) from your brow
|
|||
|
||||
## 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
|
||||
# [...]
|
||||
|
@ -538,6 +539,7 @@ defmodule Example.Accounts.User.Senders.SendPasswordResetEmail do
|
|||
use AshAuthentication.Sender
|
||||
use ExampleWeb, :verified_routes
|
||||
|
||||
@impl AshAuthentication.Sender
|
||||
def send(user, token, _) do
|
||||
Example.Accounts.Emails.deliver_reset_password_instructions(
|
||||
user,
|
||||
|
|
Loading…
Reference in a new issue