Skip to content

Commit

Permalink
Do not use .input type=hidden on phx.gen.auth
Browse files Browse the repository at this point in the history
  • Loading branch information
josevalim committed Feb 6, 2024
1 parent 712ad7e commit aaac850
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion priv/templates/phx.gen.auth/confirmation_live.ex
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ defmodule <%= inspect context.web_module %>.<%= inspect Module.concat(schema.web
<.header class="text-center">Confirm Account</.header>
<.simple_form for={@form} id="confirmation_form" phx-submit="confirm_account">
<.input field={@form[:token]} type="hidden" />
<input type="hidden" name={@form[:token].name} value={@form[:token].value} />
<:actions>
<.button phx-disable-with="Confirming..." class="w-full">Confirm my account</.button>
</:actions>
Expand Down
4 changes: 2 additions & 2 deletions priv/templates/phx.gen.auth/settings_edit.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
Oops, something went wrong! Please check the errors below.
</.error>

<.input field={f[:action]} type="hidden" name="action" value="update_email" />
<input type="hidden" name="action" value="update_email" />

<.input field={f[:email]} type="email" label="Email" required />
<.input
Expand All @@ -37,7 +37,7 @@
Oops, something went wrong! Please check the errors below.
</.error>

<.input field={f[:action]} type="hidden" name="action" value="update_password" />
<input type="hidden" name="action" value="update_password" />

<.input field={f[:password]} type="password" label="New password" required />
<.input
Expand Down
4 changes: 2 additions & 2 deletions priv/templates/phx.gen.auth/settings_live.ex
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ defmodule <%= inspect context.web_module %>.<%= inspect Module.concat(schema.web
phx-submit="update_password"
phx-trigger-action={@trigger_submit}
>
<.input
field={@password_form[:email]}
<input
name={@password_form[:email].name}
type="hidden"
id="hidden_<%= schema.singular %>_email"
value={@current_email}
Expand Down

0 comments on commit aaac850

Please sign in to comment.