Compare commits
15 commits
edb3978b64
...
ccf2d61d84
| Author | SHA1 | Date | |
|---|---|---|---|
| ccf2d61d84 | |||
| 490b2c2f68 | |||
|
|
d620e9077a | ||
| 7aa53dc9ef | |||
| aa843933f9 | |||
| 4dd114c22a | |||
| 2255dfbf6e | |||
| c2cb75a32b | |||
| acaa12fea6 | |||
| 15d6fd38c9 | |||
| afda276d22 | |||
| 0334260de5 | |||
| 50832da885 | |||
| d89b1d1cc0 | |||
|
|
8cb023dc61 |
2 changed files with 6 additions and 15 deletions
|
|
@ -99,7 +99,7 @@ defmodule Mv.Accounts.User do
|
|||
|
||||
changeset
|
||||
|> Ash.Changeset.change_attribute(:email, user_info["preferred_username"])
|
||||
|> Ash.Changeset.change_attribute(:oidc_id, user_info["sub"] || user_info["id"])
|
||||
|> Ash.Changeset.change_attribute(:oidc_id, user_info["id"])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -12,28 +12,22 @@ defmodule MvWeb.UserLive.Form do
|
|||
|
||||
<.form for={@form} id="user-form" phx-change="validate" phx-submit="save">
|
||||
<.input field={@form[:email]} label={gettext("Email")} required type="email" />
|
||||
|
||||
|
||||
<%= if @user do %>
|
||||
<div class="mt-4 p-4 bg-blue-50 rounded-lg">
|
||||
<p class="text-sm text-blue-800">
|
||||
<strong>{gettext("Note")}:</strong> {gettext(
|
||||
"Password can only be changed through authentication functions."
|
||||
)}
|
||||
<strong>{gettext("Note")}:</strong> {gettext("Password can only be changed through authentication functions.")}
|
||||
</p>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="mt-4 p-4 bg-yellow-50 rounded-lg">
|
||||
<p class="text-sm text-yellow-800">
|
||||
<strong>{gettext("Note")}:</strong> {gettext(
|
||||
"Users created here will need to set their password through the authentication system."
|
||||
)}
|
||||
<strong>{gettext("Note")}:</strong> {gettext("Users created here will need to set their password through the authentication system.")}
|
||||
</p>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<.button phx-disable-with={gettext("Saving...")} variant="primary">
|
||||
{gettext("Save User")}
|
||||
</.button>
|
||||
<.button phx-disable-with={gettext("Saving...")} variant="primary">{gettext("Save User")}</.button>
|
||||
<.button navigate={return_path(@return_to, @user)}>{gettext("Cancel")}</.button>
|
||||
</.form>
|
||||
</Layouts.app>
|
||||
|
|
@ -91,10 +85,7 @@ defmodule MvWeb.UserLive.Form do
|
|||
if user do
|
||||
AshPhoenix.Form.for_update(user, :update_user, domain: Mv.Accounts, as: "user")
|
||||
else
|
||||
AshPhoenix.Form.for_create(Mv.Accounts.User, :create_user,
|
||||
domain: Mv.Accounts,
|
||||
as: "user"
|
||||
)
|
||||
AshPhoenix.Form.for_create(Mv.Accounts.User, :create_user, domain: Mv.Accounts, as: "user")
|
||||
end
|
||||
|
||||
assign(socket, form: to_form(form))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue