berrypod/lib/berrypod_web/live/auth/settings.ex
jamey 9528700862 rename project from SimpleshopTheme to Berrypod
All modules, configs, paths, and references updated.
836 tests pass, zero warnings.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 21:23:15 +00:00

31 lines
827 B
Elixir

defmodule BerrypodWeb.Auth.Settings do
use BerrypodWeb, :live_view
alias Berrypod.Accounts
# Confirm-email token: process it and redirect to admin settings
@impl true
def mount(%{"token" => token}, _session, socket) do
socket =
case Accounts.update_user_email(socket.assigns.current_scope.user, token) do
{:ok, _user} ->
put_flash(socket, :info, "Email changed successfully.")
{:error, _} ->
put_flash(socket, :error, "Email change link is invalid or it has expired.")
end
{:ok, redirect(socket, to: ~p"/admin/settings")}
end
# Main mount: just redirect — account settings live in admin now
def mount(_params, _session, socket) do
{:ok, redirect(socket, to: ~p"/admin/settings")}
end
@impl true
def render(assigns) do
~H""
end
end