Hello I am using Pow Assent to setup Github oauth for my project. However I’m running into the following error:
warning: invalid association `user_identities` in schema Profilo.Accounts.Lib.User: associated schema Profi
lo.Accounts.UserIdentities.UserIdentity does not exist
lib/profilo/accounts/lib/user.ex:1: Profilo.Accounts.Lib.User (module)
user_identitiy.ex
defmodule Profilo.Accounts.Lib.UserIdentities.UserIdentity do
use Ecto.Schema
use PowAssent.Ecto.UserIdentities.Schema, user: Profilo.Accounts.Lib.User
schema "user_identities" do
pow_assent_user_identity_fields()
timestamps(updated_at: false)
end
end
user.ex
defmodule Profilo.Accounts.Lib.User do
use Ecto.Schema
use Pow.Ecto.Schema
use PowAssent.Ecto.Schema
import Ecto.Changeset
alias Bcrypt
schema "users" do
field :first_name, :string
field :last_name, :string
field :address, :string
field :company, :string
field :phone_number, :string
field :website, :string
field :is_admin, :boolean, default: false
pow_user_fields()
timestamps()
end
@required_fields ~w(first_name last_name)a
@optional_fields ~w(address company phone_number website)a
def changeset(user, attrs) do
user
|> pow_changeset(attrs)
|> cast(attrs, @required_fields ++ @optional_fields)
|> validate_required(@required_fields)
end
end
I feel like the error has to with my project structure. Although I am not sure how to change PowAssent config for user_identity.