From 99668f904ba4c24db8e4d0f9556fdfa7d1b04170 Mon Sep 17 00:00:00 2001 From: Zach Daniel Date: Thu, 12 Jan 2023 23:28:44 -0500 Subject: [PATCH] chore: fix build/check --- .../accounts/resources/user/senders/send_confirmation_email.ex | 3 +++ .../resources/user/senders/send_password_reset_email.ex | 3 +++ lib/ash_hq/accounts/resources/user/user.ex | 2 +- lib/ash_hq/accounts/secrets.ex | 1 + lib/ash_hq_web.ex | 2 +- lib/ash_hq_web/auth_overrides.ex | 1 + lib/ash_hq_web/live_user_auth.ex | 3 ++- lib/ash_hq_web/routes.ex | 1 + test/support/conn_case.ex | 2 +- 9 files changed, 14 insertions(+), 4 deletions(-) diff --git a/lib/ash_hq/accounts/resources/user/senders/send_confirmation_email.ex b/lib/ash_hq/accounts/resources/user/senders/send_confirmation_email.ex index fab033c..7ae0fd9 100644 --- a/lib/ash_hq/accounts/resources/user/senders/send_confirmation_email.ex +++ b/lib/ash_hq/accounts/resources/user/senders/send_confirmation_email.ex @@ -1,4 +1,7 @@ defmodule AshHq.Accounts.User.Senders.SendConfirmationEmail do + @moduledoc """ + Sends a confirmation email for initial sign up or email change. + """ use AshAuthentication.Sender use AshHqWeb, :verified_routes diff --git a/lib/ash_hq/accounts/resources/user/senders/send_password_reset_email.ex b/lib/ash_hq/accounts/resources/user/senders/send_password_reset_email.ex index 2daab0b..7c681f6 100644 --- a/lib/ash_hq/accounts/resources/user/senders/send_password_reset_email.ex +++ b/lib/ash_hq/accounts/resources/user/senders/send_password_reset_email.ex @@ -1,4 +1,7 @@ defmodule AshHq.Accounts.User.Senders.SendPasswordResetEmail do + @moduledoc """ + Sends a password reset email + """ use AshAuthentication.Sender use AshHqWeb, :verified_routes diff --git a/lib/ash_hq/accounts/resources/user/user.ex b/lib/ash_hq/accounts/resources/user/user.ex index f326ffe..65bb141 100644 --- a/lib/ash_hq/accounts/resources/user/user.ex +++ b/lib/ash_hq/accounts/resources/user/user.ex @@ -212,7 +212,7 @@ defmodule AshHq.Accounts.User do changeset - response -> + _ -> Ash.Changeset.add_error(changeset, "Could not determine what email to use") end end) diff --git a/lib/ash_hq/accounts/secrets.ex b/lib/ash_hq/accounts/secrets.ex index 58f4da4..ff55562 100644 --- a/lib/ash_hq/accounts/secrets.ex +++ b/lib/ash_hq/accounts/secrets.ex @@ -1,4 +1,5 @@ defmodule AshHq.Accounts.Secrets do + @moduledoc "Secrets adapter for AshHq authentication" use AshAuthentication.Secret @github_secret_keys ~w(client_id client_secret redirect_uri)a diff --git a/lib/ash_hq_web.ex b/lib/ash_hq_web.ex index bff9e15..6864b91 100644 --- a/lib/ash_hq_web.ex +++ b/lib/ash_hq_web.ex @@ -120,7 +120,7 @@ defmodule AshHqWeb do end end - def static_paths() do + def static_paths do ~w(assets fonts images favicon.ico robots.txt) end diff --git a/lib/ash_hq_web/auth_overrides.ex b/lib/ash_hq_web/auth_overrides.ex index b007ecb..5552d1d 100644 --- a/lib/ash_hq_web/auth_overrides.ex +++ b/lib/ash_hq_web/auth_overrides.ex @@ -1,4 +1,5 @@ defmodule AshHqWeb.AuthOverrides do + @moduledoc "UI overrides for authentication views" use AshAuthentication.Phoenix.Overrides alias AshAuthentication.Phoenix.Components diff --git a/lib/ash_hq_web/live_user_auth.ex b/lib/ash_hq_web/live_user_auth.ex index 12137f1..42066fa 100644 --- a/lib/ash_hq_web/live_user_auth.ex +++ b/lib/ash_hq_web/live_user_auth.ex @@ -3,7 +3,8 @@ defmodule AshHqWeb.LiveUserAuth do Helpers for authenticating users in liveviews """ - use AshHqWeb, :component + import Phoenix.Component + use AshHqWeb, :verified_routes def on_mount(:live_user_optional, _params, _session, socket) do if socket.assigns[:current_user] do diff --git a/lib/ash_hq_web/routes.ex b/lib/ash_hq_web/routes.ex index 2238d81..739d63c 100644 --- a/lib/ash_hq_web/routes.ex +++ b/lib/ash_hq_web/routes.ex @@ -1,4 +1,5 @@ defmodule AshHqWeb.Routes do + @moduledoc "Route helpers" def url(path) do Application.get_env(:ash_hq, :url) <> "/" <> String.trim_leading(path, "/") end diff --git a/test/support/conn_case.ex b/test/support/conn_case.ex index 7ef7a8d..4990096 100644 --- a/test/support/conn_case.ex +++ b/test/support/conn_case.ex @@ -62,7 +62,7 @@ defmodule AshHqWeb.ConnCase do } end - defp test_user() do + defp test_user do user = AshHq.Accounts.User.register_with_password!( "test@example.com",