Add seed script for admin user

This commit is contained in:
Rafael Epplée 2025-08-04 14:03:26 +02:00 committed by rafael
parent 9e462a1c16
commit dd77be0388
3 changed files with 8 additions and 1 deletions

View file

@ -4,6 +4,7 @@
#
alias Mv.Membership
alias Mv.Accounts
for attrs <- [
%{
@ -41,3 +42,8 @@ for attrs <- [
upsert_identity: :unique_name
)
end
# Create admin user for testing
Accounts.create_user!(%{email: "admin@mv.local"}, upsert?: true, upsert_identity: :unique_email)
|> Ash.Changeset.for_update(:admin_set_password, %{password: "testpassword"})
|> Ash.update!()