Show persistent magic-link delivery guidance
Some checks are pending
Quality / full-local-gates (push) Waiting to run
Some checks are pending
Quality / full-local-gates (push) Waiting to run
This commit is contained in:
parent
88a6373693
commit
e671e104c7
|
|
@ -1,7 +1,7 @@
|
||||||
<.header>
|
<.header>
|
||||||
{gettext("Check your email")}
|
{gettext("Check your email")}
|
||||||
<:subtitle>
|
<:subtitle>
|
||||||
{gettext("Your confirmation link is on its way.")}
|
{gettext("If the address can be used, a secure link will arrive shortly.")}
|
||||||
</:subtitle>
|
</:subtitle>
|
||||||
</.header>
|
</.header>
|
||||||
|
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
<h2 class="text-lg font-bold">{gettext("Open the newest Who Need Help email")}</h2>
|
<h2 class="text-lg font-bold">{gettext("Open the newest Who Need Help email")}</h2>
|
||||||
<p class="mt-2 text-sm leading-6 text-base-content/70">
|
<p class="mt-2 text-sm leading-6 text-base-content/70">
|
||||||
{gettext(
|
{gettext(
|
||||||
"Use the confirmation link in that email. You do not need to enter your address again on this site."
|
"If a message arrives, use the secure link in it. You do not need to enter your address again on this site."
|
||||||
)}
|
)}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -100,7 +100,7 @@ defmodule WhoNeedHelpWeb.UserSessionController do
|
||||||
|
|
||||||
conn
|
conn
|
||||||
|> put_flash(:info, info)
|
|> put_flash(:info, info)
|
||||||
|> redirect(to: ~p"/users/log-in")
|
|> redirect(to: ~p"/users/check-email")
|
||||||
|
|
||||||
{:error, :rate_limited} ->
|
{:error, :rate_limited} ->
|
||||||
conn
|
conn
|
||||||
|
|
|
||||||
|
|
@ -179,6 +179,7 @@ defmodule WhoNeedHelpWeb.UserSessionControllerTest do
|
||||||
})
|
})
|
||||||
|
|
||||||
assert Phoenix.Flash.get(conn.assigns.flash, :info) =~ "If your email is in our system"
|
assert Phoenix.Flash.get(conn.assigns.flash, :info) =~ "If your email is in our system"
|
||||||
|
assert redirected_to(conn) == ~p"/users/check-email"
|
||||||
assert WhoNeedHelp.Repo.get_by!(Accounts.UserToken, user_id: user.id).context == "login"
|
assert WhoNeedHelp.Repo.get_by!(Accounts.UserToken, user_id: user.id).context == "login"
|
||||||
|
|
||||||
assert_email_sent(fn email ->
|
assert_email_sent(fn email ->
|
||||||
|
|
@ -198,7 +199,7 @@ defmodule WhoNeedHelpWeb.UserSessionControllerTest do
|
||||||
"user" => %{"email" => user.email}
|
"user" => %{"email" => user.email}
|
||||||
})
|
})
|
||||||
|
|
||||||
assert redirected_to(conn) == ~p"/users/log-in"
|
assert redirected_to(conn) == ~p"/users/check-email"
|
||||||
refute WhoNeedHelp.Repo.get_by(Accounts.UserToken, user_id: user.id)
|
refute WhoNeedHelp.Repo.get_by(Accounts.UserToken, user_id: user.id)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user