Ash FrameworkAF
Ash Framework4mo ago
9 replies
theron

Authentication error

  def user_fixture(attrs \\ %{}) do
    email = Map.get(attrs, :email, "user-#{System.unique_integer()}@example.com")

    {:ok, user} =
      case "password-#{System.unique_integer()}" do
        password ->
          Accounts.User
          |> Ash.Changeset.for_create(:register_with_password, %{
            email: email,
            # shop_id: shop.id,
            # first_name: Map.get(attrs, :first_name, "Test"),
            # last_name: Map.get(attrs, :last_name, "User"),
            password: password,
            password_confirmation: password
          })
          |> Ash.create()
      end

    user
  end


Gives this error (attached)
Solution
Like usually i would set current_user: user on my conn but it appears ash is doing something different
Was this page helpful?