From 7118782a2dabe20fef50afe52e2ca357c5f61251 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Eppl=C3=A9e?= Date: Thu, 21 Aug 2025 14:09:03 +0200 Subject: [PATCH 1/2] Add seed data for members --- priv/repo/seeds.exs | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/priv/repo/seeds.exs b/priv/repo/seeds.exs index 306b627..cb38969 100644 --- a/priv/repo/seeds.exs +++ b/priv/repo/seeds.exs @@ -47,3 +47,48 @@ end Accounts.create_user!(%{email: "admin@mv.local"}, upsert?: true, upsert_identity: :unique_email) |> Ash.Changeset.for_update(:admin_set_password, %{password: "testpassword"}) |> Ash.update!() + +# Create sample members for testing +for member_attrs <- [ + %{ + first_name: "Hans", + last_name: "Müller", + email: "hans.mueller@example.de", + birth_date: ~D[1985-06-15], + join_date: ~D[2023-01-15], + paid: true, + phone_number: "+49301234567", + city: "München", + street: "Hauptstraße", + house_number: "42", + postal_code: "80331" + }, + %{ + first_name: "Greta", + last_name: "Schmidt", + email: "greta.schmidt@example.de", + birth_date: ~D[1990-03-22], + join_date: ~D[2023-02-01], + paid: false, + phone_number: "+49309876543", + city: "Hamburg", + street: "Lindenstraße", + house_number: "17", + postal_code: "20095", + notes: "Interessiert an Fortgeschrittenen-Kursen" + }, + %{ + first_name: "Friedrich", + last_name: "Wagner", + email: "friedrich.wagner@example.de", + birth_date: ~D[1978-11-08], + join_date: ~D[2022-11-10], + paid: true, + phone_number: "+49301122334", + city: "Berlin", + street: "Kastanienallee", + house_number: "8" + } + ] do + Membership.create_member!(member_attrs) +end From a3746dfaaa5aa9e32a7b6dd82dad0d494d86e5ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Eppl=C3=A9e?= Date: Thu, 11 Sep 2025 11:49:23 +0200 Subject: [PATCH 2/2] Explicitly require ash authentication settings Previously, we'd rely on defaults for configuring user token authentication. With these changes, we explicitly require :session_identifier and :require_token_presence_for_authentication to be configured in the application environment to make sure the system is configured the way it should be. --- lib/accounts/user.ex | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/accounts/user.ex b/lib/accounts/user.ex index 9294526..b085407 100644 --- a/lib/accounts/user.ex +++ b/lib/accounts/user.ex @@ -19,16 +19,15 @@ defmodule Mv.Accounts.User do Currently password and SSO with Rauthy as OIDC provider """ authentication do - session_identifier Application.compile_env(:mv, :session_identifier, :jti) + session_identifier Application.compile_env!(:mv, :session_identifier) tokens do enabled? true token_resource Mv.Accounts.Token - require_token_presence_for_authentication? Application.compile_env( + require_token_presence_for_authentication? Application.compile_env!( :mv, - :require_token_presence_for_authentication, - false + :require_token_presence_for_authentication ) store_all_tokens? true