jonbirke0927
I am working on changing the UI of the reset password form generated by phx_gen_auth. The current state of said form is as follows:
<div class="flex min-h-full flex-col justify-center py-12 sm:px-6 lg:px-8">
<div class="sm:mx-auto sm:w-full sm:max-w-md">
<h2 class="mt-6 text-center text-3xl font-bold tracking-tight text-gray-900">Reset password</h2>
</div>
<div class="mt-8 sm:mx-auto sm:w-full sm:max-w-md">
<div class="bg-white py-8 px-4 shadow sm:rounded-lg sm:px-10">
<.form let={f} for={@changeset} action={Routes.account_reset_password_path(@conn, :update, @token)} class="space-y-6">
<%= if @changeset.action do %>
<div class="alert alert-danger">
<p>Oops, something went wrong! Please check the errors below.</p>
</div>
<% end %>
<div>
<%= label f, :password, "New password", class: "block text-sm font-medium text-gray-700" %>
<div class="mt-1">
<%= password_input f, :password, required: true, id: "password", name: "password", type: "password", autocomplete: "current-password", class: "block w-full appearance-none rounded-md border border-gray-300 px-3 py-2 placeholder-gray-400 shadow-sm focus:border-indigo-500 focus:outline-none focus:ring-indigo-500 sm:text-sm" %>
</div>
<%= error_tag f, :password %>
</div>
<div>
<%= label f, :password_confirmation, "Confirm new password", class: "block text-sm font-medium text-gray-700" %>
<div class="mt-1">
<%= password_input f, :password_confirmation, required: true, type: "password", autocomplete: "current-password", class: "block w-full appearance-none rounded-md border border-gray-300 px-3 py-2 placeholder-gray-400 shadow-sm focus:border-indigo-500 focus:outline-none focus:ring-indigo-500 sm:text-sm" %>
</div>
<%= error_tag f, :password_confirmation %>
</div>
<%= submit "Reset password", class: "flex w-full justify-center rounded-md border border-transparent bg-indigo-600 py-2 px-4 text-sm font-medium text-white shadow-sm hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2" %>
<div class="flex items-center justify-between">
<div class="text-sm">
<%= link "Register account", to: Routes.account_registration_path(@conn, :new), class: "font-medium text-indigo-600 hover:text-indigo-500" %>
</div>
<div class="text-sm">
<%= link "Sign in to existing account", to: Routes.account_session_path(@conn, :new), class: "font-medium text-indigo-600 hover:text-indigo-500" %>
</div>
</div>
</.form>
</div>
</div>
</div>
When the params hit the controller, the shape is as follows:
%{
"_csrf_token" => "LwoWc1UTKTp5GEJfaBAbVRERBjI2AQV7IzrB2IHxNWzi8hJbdUCznrNM",
"_method" => "put",
"account" => %{"password_confirmation" => "password"},
"password" => "password1234",
"token" => "hEo-B4dUBnuThrqBTntws_hFBmqSVMA_JDFJcMh_2sk"
}
My question is, why is only the “password_confirmation” input nested under the key “account”? Am I able to control / change this?
Trending in Questions
I having some trouble figuring out if I have set myself too strict of standards for my production server. Currently I can handle 75% of r...
New
Hello,
I’m trying to build a basic Phoenix web-app, and I’d like to use Tailwind.
However, when I launch mix phx.server, I get an error...
New
Hi everyone,
I am toying with the idea of building a “match maker” for giving personal help to people that wants to start coding.
I sta...
New
I’m working on a small exercise involving update_in/3, and I came up with this solution:
data = %{
name: "Periodic Table",
category:...
New
I’ve got trouble wrapping my head around the order in which functions are called in this snippet (from Phoenix’s authentication):
toke...
New
Is there any way to avoid the Hologram compiler running when using iex? It seems like the front-end code could potentially be disregarded...
New
** (ArgumentError) expected :max_attempts to be a positive integer, got: {:@, [line: 10, column: 19], [{:max_attempts, [line: 10, column:...
New
Other Trending Topics
Edit: 2026 May 15 - This post is archived.
Mob is alive!!
Main docs: mob v0.7.11 — Documentation
A bit of explanation for the slightly c...
New
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hobbes is a low-level distributed database for the Elixir programming language.
Hobbes provides a simple, safe, and scalable storage lay...
New
A little off-topic, but I feel like people here have a good head on their shoulders.
I used to be quite good at making software. Was luc...
New
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ai
- #ecto-query
- #elixirconf-us
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #elixirconf-eu
- #api
- #forms
- #metaprogramming
- #hex











Showing Posts 1 to 1- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
woylie
You are overriding the default input name here. If you remove the
nameoption, it should be nested.