Add seed script for admin user
This commit is contained in:
parent
9e462a1c16
commit
dd77be0388
3 changed files with 8 additions and 1 deletions
|
|
@ -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!()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue