WIP
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Moritz 2025-07-25 01:54:24 +02:00
parent 4e6f5a517a
commit e74e7cbd31
Signed by: moritz
GPG key ID: 1020A035E5DD0824
3 changed files with 307 additions and 69 deletions

View file

@ -66,10 +66,15 @@ defmodule Mv.Accounts.User do
create :create_user do
accept [:email, :member_id]
argument :member, :map
change manage_relationship(:member, type: :create)
end
update :update_user do
require_atomic? false
accept [:email, :member_id]
argument :member, :map
change manage_relationship(:member, on_match: :update, on_no_match: :create)
end
# Admin action for direct password changes in admin panel
@ -118,6 +123,16 @@ defmodule Mv.Accounts.User do
|> Ash.Changeset.change_attribute(:oidc_id, user_info["sub"] || user_info["id"])
end
end
create :register_with_password do
accept [:email]
argument :password, :string, allow_nil?: false, sensitive?: true
argument :password_confirmation, :string, allow_nil?: false, sensitive?: true
argument :member, :map
change AshAuthentication.Strategy.Password.HashPasswordChange
change AshAuthentication.GenerateTokenChange
change manage_relationship(:member, type: :create)
end
end
# Global validations - applied to all relevant actions