From b6d1a27bc91f9d30a5ca104f0217502a2558e233 Mon Sep 17 00:00:00 2001 From: Moritz Date: Wed, 4 Feb 2026 11:06:59 +0100 Subject: [PATCH] Seeds: only admin gets password; additional users without password - Additional users (hans, greta, maria, thomas) created without admin_set_password. - Removed no-password@example.de user. --- priv/repo/seeds.exs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/priv/repo/seeds.exs b/priv/repo/seeds.exs index 579b7cc..e97e7c2 100644 --- a/priv/repo/seeds.exs +++ b/priv/repo/seeds.exs @@ -228,7 +228,7 @@ case Accounts.User |> Ash.update!(authorize?: false) {:ok, nil} -> - # User doesn't exist - create admin user with password + # User doesn't exist - create admin user and set password (so Password column shows "Enabled") # Use authorize?: false for bootstrap - no admin user exists yet to use as actor Accounts.create_user!(%{email: admin_email}, upsert?: true, @@ -457,7 +457,8 @@ Enum.each(member_attrs_list, fn member_attrs -> end end) -# Create additional users for user-member linking examples +# Create additional users for user-member linking examples (no password by default) +# Only admin gets a password (admin_set_password when created); all other users have no password. additional_users = [ %{email: "hans.mueller@example.de"}, %{email: "greta.schmidt@example.de"}, @@ -467,15 +468,12 @@ additional_users = [ created_users = Enum.map(additional_users, fn user_attrs -> - # Use admin user as actor for additional user creation (not bootstrap) user = Accounts.create_user!(user_attrs, upsert?: true, upsert_identity: :unique_email, actor: admin_user_with_role ) - |> Ash.Changeset.for_update(:admin_set_password, %{password: "testpassword"}) - |> Ash.update!(actor: admin_user_with_role) # Reload user to ensure all fields (including member_id) are loaded Accounts.User