fix account urls
This commit is contained in:
parent
8e1bb5c333
commit
e218290e08
19 changed files with 102 additions and 102 deletions
|
@ -162,7 +162,7 @@ defmodule Wild.Accounts do
|
|||
|
||||
## Examples
|
||||
|
||||
iex> deliver_user_update_email_instructions(user, current_email, &url(~p"/users/settings/confirm_email/#{&1}"))
|
||||
iex> deliver_user_update_email_instructions(user, current_email, &url(~p"/account/settings/confirm_email/#{&1}"))
|
||||
{:ok, %{to: ..., body: ...}}
|
||||
|
||||
"""
|
||||
|
@ -249,10 +249,10 @@ defmodule Wild.Accounts do
|
|||
|
||||
## Examples
|
||||
|
||||
iex> deliver_user_confirmation_instructions(user, &url(~p"/users/confirm/#{&1}"))
|
||||
iex> deliver_user_confirmation_instructions(user, &url(~p"/account/confirm/#{&1}"))
|
||||
{:ok, %{to: ..., body: ...}}
|
||||
|
||||
iex> deliver_user_confirmation_instructions(confirmed_user, &url(~p"/users/confirm/#{&1}"))
|
||||
iex> deliver_user_confirmation_instructions(confirmed_user, &url(~p"/account/confirm/#{&1}"))
|
||||
{:error, :already_confirmed}
|
||||
|
||||
"""
|
||||
|
@ -296,7 +296,7 @@ defmodule Wild.Accounts do
|
|||
|
||||
## Examples
|
||||
|
||||
iex> deliver_user_reset_password_instructions(user, &url(~p"/users/reset_password/#{&1}"))
|
||||
iex> deliver_user_reset_password_instructions(user, &url(~p"/account/reset_password/#{&1}"))
|
||||
{:ok, %{to: ..., body: ...}}
|
||||
|
||||
"""
|
||||
|
|
|
@ -10,7 +10,7 @@ defmodule WildWeb.UserSessionController do
|
|||
|
||||
def create(conn, %{"_action" => "password_updated"} = params) do
|
||||
conn
|
||||
|> put_session(:user_return_to, ~p"/users/settings")
|
||||
|> put_session(:user_return_to, ~p"/account/settings")
|
||||
|> create(params, "Password updated successfully!")
|
||||
end
|
||||
|
||||
|
@ -30,7 +30,7 @@ defmodule WildWeb.UserSessionController do
|
|||
conn
|
||||
|> put_flash(:error, "Invalid email or password")
|
||||
|> put_flash(:email, String.slice(email, 0, 160))
|
||||
|> redirect(to: ~p"/users/log_in")
|
||||
|> redirect(to: ~p"/account/log_in")
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -21,8 +21,8 @@ defmodule WildWeb.UserConfirmationInstructionsLive do
|
|||
</.simple_form>
|
||||
|
||||
<p class="text-center mt-4">
|
||||
<.link href={~p"/users/register"}>Register</.link>
|
||||
| <.link href={~p"/users/log_in"}>Log in</.link>
|
||||
<.link href={~p"/account/register"}>Register</.link>
|
||||
| <.link href={~p"/account/log_in"}>Log in</.link>
|
||||
</p>
|
||||
</div>
|
||||
"""
|
||||
|
@ -36,7 +36,7 @@ defmodule WildWeb.UserConfirmationInstructionsLive do
|
|||
if user = Accounts.get_user_by_email(email) do
|
||||
Accounts.deliver_user_confirmation_instructions(
|
||||
user,
|
||||
&url(~p"/users/confirm/#{&1}")
|
||||
&url(~p"/account/confirm/#{&1}")
|
||||
)
|
||||
end
|
||||
|
||||
|
|
|
@ -16,8 +16,8 @@ defmodule WildWeb.UserConfirmationLive do
|
|||
</.simple_form>
|
||||
|
||||
<p class="text-center mt-4">
|
||||
<.link href={~p"/users/register"}>Register</.link>
|
||||
| <.link href={~p"/users/log_in"}>Log in</.link>
|
||||
<.link href={~p"/account/register"}>Register</.link>
|
||||
| <.link href={~p"/account/log_in"}>Log in</.link>
|
||||
</p>
|
||||
</div>
|
||||
"""
|
||||
|
|
|
@ -20,8 +20,8 @@ defmodule WildWeb.UserForgotPasswordLive do
|
|||
</:actions>
|
||||
</.simple_form>
|
||||
<p class="text-center text-sm mt-4">
|
||||
<.link href={~p"/users/register"}>Register</.link>
|
||||
| <.link href={~p"/users/log_in"}>Log in</.link>
|
||||
<.link href={~p"/account/register"}>Register</.link>
|
||||
| <.link href={~p"/account/log_in"}>Log in</.link>
|
||||
</p>
|
||||
</div>
|
||||
"""
|
||||
|
@ -35,7 +35,7 @@ defmodule WildWeb.UserForgotPasswordLive do
|
|||
if user = Accounts.get_user_by_email(email) do
|
||||
Accounts.deliver_user_reset_password_instructions(
|
||||
user,
|
||||
&url(~p"/users/reset_password/#{&1}")
|
||||
&url(~p"/account/reset_password/#{&1}")
|
||||
)
|
||||
end
|
||||
|
||||
|
|
|
@ -8,20 +8,20 @@ defmodule WildWeb.UserLoginLive do
|
|||
Log in to account
|
||||
<:subtitle>
|
||||
Don't have an account?
|
||||
<.link navigate={~p"/users/register"} class="font-semibold text-brand hover:underline">
|
||||
<.link navigate={~p"/account/register"} class="font-semibold text-brand hover:underline">
|
||||
Sign up
|
||||
</.link>
|
||||
for an account now.
|
||||
</:subtitle>
|
||||
</.header>
|
||||
|
||||
<.simple_form for={@form} id="login_form" action={~p"/users/log_in"} phx-update="ignore">
|
||||
<.simple_form for={@form} id="login_form" action={~p"/account/log_in"} phx-update="ignore">
|
||||
<.input field={@form[:email]} type="email" label="Email" required />
|
||||
<.input field={@form[:password]} type="password" label="Password" required />
|
||||
|
||||
<:actions>
|
||||
<.input field={@form[:remember_me]} type="checkbox" label="Keep me logged in" />
|
||||
<.link href={~p"/users/reset_password"} class="text-sm font-semibold">
|
||||
<.link href={~p"/account/reset_password"} class="text-sm font-semibold">
|
||||
Forgot your password?
|
||||
</.link>
|
||||
</:actions>
|
||||
|
|
|
@ -11,7 +11,7 @@ defmodule WildWeb.UserRegistrationLive do
|
|||
Register for an account
|
||||
<:subtitle>
|
||||
Already registered?
|
||||
<.link navigate={~p"/users/log_in"} class="font-semibold text-brand hover:underline">
|
||||
<.link navigate={~p"/account/log_in"} class="font-semibold text-brand hover:underline">
|
||||
Log in
|
||||
</.link>
|
||||
to your account now.
|
||||
|
@ -24,7 +24,7 @@ defmodule WildWeb.UserRegistrationLive do
|
|||
phx-submit="save"
|
||||
phx-change="validate"
|
||||
phx-trigger-action={@trigger_submit}
|
||||
action={~p"/users/log_in?_action=registered"}
|
||||
action={~p"/account/log_in?_action=registered"}
|
||||
method="post"
|
||||
>
|
||||
<.error :if={@check_errors}>
|
||||
|
@ -59,7 +59,7 @@ defmodule WildWeb.UserRegistrationLive do
|
|||
{:ok, _} =
|
||||
Accounts.deliver_user_confirmation_instructions(
|
||||
user,
|
||||
&url(~p"/users/confirm/#{&1}")
|
||||
&url(~p"/account/confirm/#{&1}")
|
||||
)
|
||||
|
||||
changeset = Accounts.change_user_registration(user)
|
||||
|
|
|
@ -31,8 +31,8 @@ defmodule WildWeb.UserResetPasswordLive do
|
|||
</.simple_form>
|
||||
|
||||
<p class="text-center text-sm mt-4">
|
||||
<.link href={~p"/users/register"}>Register</.link>
|
||||
| <.link href={~p"/users/log_in"}>Log in</.link>
|
||||
<.link href={~p"/account/register"}>Register</.link>
|
||||
| <.link href={~p"/account/log_in"}>Log in</.link>
|
||||
</p>
|
||||
</div>
|
||||
"""
|
||||
|
@ -61,7 +61,7 @@ defmodule WildWeb.UserResetPasswordLive do
|
|||
{:noreply,
|
||||
socket
|
||||
|> put_flash(:info, "Password reset successfully.")
|
||||
|> redirect(to: ~p"/users/log_in")}
|
||||
|> redirect(to: ~p"/account/log_in")}
|
||||
|
||||
{:error, changeset} ->
|
||||
{:noreply, assign_form(socket, Map.put(changeset, :action, :insert))}
|
||||
|
|
|
@ -37,7 +37,7 @@ defmodule WildWeb.UserSettingsLive do
|
|||
<.simple_form
|
||||
for={@password_form}
|
||||
id="password_form"
|
||||
action={~p"/users/log_in?_action=password_updated"}
|
||||
action={~p"/account/log_in?_action=password_updated"}
|
||||
method="post"
|
||||
phx-change="validate_password"
|
||||
phx-submit="update_password"
|
||||
|
@ -83,7 +83,7 @@ defmodule WildWeb.UserSettingsLive do
|
|||
put_flash(socket, :error, "Email change link is invalid or it has expired.")
|
||||
end
|
||||
|
||||
{:ok, push_navigate(socket, to: ~p"/users/settings")}
|
||||
{:ok, push_navigate(socket, to: ~p"/account/settings")}
|
||||
end
|
||||
|
||||
def mount(_params, _session, socket) do
|
||||
|
@ -124,7 +124,7 @@ defmodule WildWeb.UserSettingsLive do
|
|||
Accounts.deliver_user_update_email_instructions(
|
||||
applied_user,
|
||||
user.email,
|
||||
&url(~p"/users/settings/confirm_email/#{&1}")
|
||||
&url(~p"/account/settings/confirm_email/#{&1}")
|
||||
)
|
||||
|
||||
info = "A link to confirm your email change has been sent to the new address."
|
||||
|
|
|
@ -158,7 +158,7 @@ defmodule WildWeb.UserAuth do
|
|||
socket =
|
||||
socket
|
||||
|> Phoenix.LiveView.put_flash(:error, "You must log in to access this page.")
|
||||
|> Phoenix.LiveView.redirect(to: ~p"/users/log_in")
|
||||
|> Phoenix.LiveView.redirect(to: ~p"/account/log_in")
|
||||
|
||||
{:halt, socket}
|
||||
end
|
||||
|
@ -208,7 +208,7 @@ defmodule WildWeb.UserAuth do
|
|||
conn
|
||||
|> put_flash(:error, "You must log in to access this page.")
|
||||
|> maybe_store_return_to()
|
||||
|> redirect(to: ~p"/users/log_in")
|
||||
|> redirect(to: ~p"/account/log_in")
|
||||
|> halt()
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue