I had authentication working, and introduced some bad data in my DB and it is now crashing. The data is in a table not the user table, so I am not sure why it is blowing up when associating a user with a subject. It looks like Ash.Authentication is keeping in the mix after authentication has completed but the view has not yet rendered and is eating the error. Still investigating on my end of course.
[info] GET /admin/companies [debug] Processing with TacitRedOTPWeb.CompanyLive.Index.index/2 Parameters: %{} Pipelines: [:browser] [info] Sent 500 in 2ms [debug] Converted error :function_clause to 500 response [error] #PID<0.1561.0> running Phoenix.Endpoint.SyncCodeReloadPlug (connection #PID<0.1159.0>, stream id 7) terminated Server: localhost:4000 (http) Request: GET /admin/companies (exit) an exception was raised: (FunctionClauseError) no function clause matching in AshAuthentication.subject_to_user/3 (ash_authentication 3.11.1) lib/ash_authentication.ex:208: AshAuthentication.subject_to_user(#TacitRedOTP.Auth.User<account: #Ash.NotLoaded<:relationship>, meta: #Ecto.Schema.Metadata<:loaded, "users">, id: "bd78bc20-1193-49e7-9cc0-e94fc010bea0", inserted_at: ~U[2023-05-19 15:04:51.743133Z], updated_at: ~U[2023-05-19 15:04:51.743133Z], email: #Ash.CiString<"michael.cogility@gmail.com">, active: true, lock_version: 1, account_id: "d7d6ee62-4422-4668-8fbe-c80a880b26cf", aggregates: %{}, calculations: %{}, order: nil, ...>, TacitRedOTP.Auth.User, [tenant: nil]) (ash_authentication_phoenix 1.7.2) lib/ash_authentication_phoenix/live_session.ex anonymous fn/4 in AshAuthentication.Phoenix.LiveSession.on_mount/4 (stdlib 4.3) maps.erl:411: :maps.fold_1/3 (ash_authentication_phoenix 1.7.2) lib/ash_authentication_phoenix/live_session.ex:97:
The Elixir backend framework for unparalleled productivity. Declarative tools that let you stop wasting time. Use with Phoenix LiveView or build APIs in minutes for your front-end of choice.