Skip to content

Commit 8020d84

Browse files
committed
Add Accounts
This adds the account infrastructure created by `mix phx.gen.auth`. This includes configuring an email client in order to send mails related to a user’s lifecycle. This commit does not yet change any of the existing routes nor how session management works.
1 parent 2e02269 commit 8020d84

File tree

14 files changed

+1350
-3
lines changed

14 files changed

+1350
-3
lines changed

config/config.exs

+9
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,15 @@ config :ex_rss, ExRssWeb.Endpoint,
2020
render_errors: [view: ExRssWeb.ErrorView, accepts: ~w(html json)],
2121
pubsub_server: ExRss.PubSub
2222

23+
# Configures the mailer
24+
#
25+
# By default it uses the "Local" adapter which stores the emails locally. You
26+
# can see the emails in your browser, at "/dev/mailbox".
27+
#
28+
# For production it's recommended to configure a different adapter at the
29+
# `config/runtime.exs`.
30+
config :ex_rss, ExRss.Mailer, adapter: Swoosh.Adapters.Local
31+
2332
# Configures Elixir's Logger
2433
config :logger, :console,
2534
format: "$time $metadata[$level] $message\n",

config/prod.exs

+6
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ import Config
77
# before starting your production server.
88
config :ex_rss, ExRss.Endpoint, cache_static_manifest: "priv/static/cache_manifest.json"
99

10+
# Configures Swoosh API Client
11+
config :swoosh, api_client: Swoosh.ApiClient.Finch, finch_name: ExRss.Finch
12+
13+
# Disable Swoosh Local Memory Storage
14+
config :swoosh, local: false
15+
1016
# Do not print debug messages in production
1117
config :logger, level: :info
1218

config/test.exs

+9
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
11
import Config
22

3+
# Only in tests, remove the complexity from the password hashing algorithm
4+
config :bcrypt_elixir, :log_rounds, 1
5+
36
# We don't run a server during test. If one is required,
47
# you can enable the server option below.
58
config :ex_rss, ExRssWeb.Endpoint,
69
http: [port: 4001],
710
server: false,
811
secret_key_base: String.duplicate("a", 64)
912

13+
# In test we don't send emails.
14+
config :lightweight_todo, ExRss.Mailer, adapter: Swoosh.Adapters.Test
15+
16+
# Disable swoosh api client as it is only required for production adapters.
17+
config :swoosh, :api_client, false
18+
1019
# Print only warnings and errors during test
1120
config :logger, level: :warning
1221

0 commit comments

Comments
 (0)